mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 21:40:13 +01:00
libnm: use nm_uuid_is_valid_nmlegacy() to implement nm_utils_is_uuid()
This commit is contained in:
parent
ce65fc52a8
commit
5bd03fd9a3
1 changed files with 1 additions and 22 deletions
|
|
@ -4438,28 +4438,7 @@ nm_utils_iface_valid_name(const char *name)
|
|||
gboolean
|
||||
nm_utils_is_uuid(const char *str)
|
||||
{
|
||||
const char *p = str;
|
||||
int num_dashes = 0;
|
||||
|
||||
if (!p)
|
||||
return FALSE;
|
||||
|
||||
while (*p) {
|
||||
if (*p == '-')
|
||||
num_dashes++;
|
||||
else if (!g_ascii_isxdigit(*p))
|
||||
return FALSE;
|
||||
p++;
|
||||
}
|
||||
|
||||
if ((num_dashes == 4) && (p - str == 36))
|
||||
return TRUE;
|
||||
|
||||
/* Backwards compat for older configurations */
|
||||
if ((num_dashes == 0) && (p - str == 40))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
return nm_uuid_is_valid_nmlegacy(str);
|
||||
}
|
||||
|
||||
static _nm_thread_local char _nm_utils_inet_ntop_buffer[NM_UTILS_INET_ADDRSTRLEN];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue