Thomas Haller 2023-12-13 09:08:31 +01:00
commit 82d7296eb1
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 18 additions and 7 deletions

View file

@ -655,8 +655,13 @@ nm_utils_is_empty_ssid(const guint8 *ssid, gsize len)
* representation of that character. Intended for debugging only, should not
* be used for display of SSIDs.
*
* Warning: this function uses a static buffer. It is not thread-safe. Don't
* use this function.
*
* Returns: pointer to the escaped SSID, which uses an internal static buffer
* and will be overwritten by subsequent calls to this function
*
* Deprecated: 1.46: use nm_utils_ssid_to_utf8() or nm_utils_bin2hexstr().
**/
const char *
nm_utils_escape_ssid(const guint8 *ssid, gsize len)

View file

@ -24,14 +24,17 @@ G_BEGIN_DECLS
typedef struct _NMVariantAttributeSpec NMVariantAttributeSpec;
/* SSID helpers */
gboolean nm_utils_is_empty_ssid(const guint8 *ssid, gsize len);
gboolean nm_utils_is_empty_ssid(const guint8 *ssid, gsize len);
NM_DEPRECATED_IN_1_46
const char *nm_utils_escape_ssid(const guint8 *ssid, gsize len);
gboolean nm_utils_same_ssid(const guint8 *ssid1,
gsize len1,
const guint8 *ssid2,
gsize len2,
gboolean ignore_trailing_null);
char *nm_utils_ssid_to_utf8(const guint8 *ssid, gsize len);
gboolean nm_utils_same_ssid(const guint8 *ssid1,
gsize len1,
const guint8 *ssid2,
gsize len2,
gboolean ignore_trailing_null);
char *nm_utils_ssid_to_utf8(const guint8 *ssid, gsize len);
/**
* NMUtilsSecurityType:

View file

@ -5970,6 +5970,9 @@ nm_utils_exp10(gint16 ex)
gboolean
_nm_utils_is_empty_ssid_arr(const guint8 *ssid, gsize len)
{
if (len == 0)
return TRUE;
/* Single white space is for Linksys APs */
if (len == 1 && ssid[0] == ' ')
return TRUE;