diff options
author | Dan Winship <danw@gnome.org> | 2012-09-25 10:44:23 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2012-09-26 12:14:37 -0400 |
commit | 6878d20ac430207b49f46c6fafe705747c02e199 (patch) | |
tree | 7e440fe71bdbff85fbd2961ddc2986fd17eba9cd /src/settings/plugins/ifnet/net_utils.c | |
parent | 74b6b9c768338ce3cd58d781fd837e6abbf3e209 (diff) | |
download | NetworkManager-6878d20ac430207b49f46c6fafe705747c02e199.tar.gz |
all: Don't use ctype.h macros
The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use
glib's ASCII-only versions instead.
Also, replace isascii() with g_ascii_isprint(), since isascii()
accepts control characters, which isn't what the code wanted in any of
the places where it was using it.
Diffstat (limited to 'src/settings/plugins/ifnet/net_utils.c')
-rw-r--r-- | src/settings/plugins/ifnet/net_utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c index d613db6a63..71949ddabb 100644 --- a/src/settings/plugins/ifnet/net_utils.c +++ b/src/settings/plugins/ifnet/net_utils.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <ctype.h> #include <errno.h> #include <nm-utils.h> #include <nm-system-config-interface.h> @@ -67,7 +66,7 @@ is_hex (const char *value) if (!p) return FALSE; while (*p) { - if (!isxdigit (*p++)) + if (!g_ascii_isxdigit (*p++)) return FALSE; } return TRUE; @@ -79,7 +78,7 @@ is_ascii (const char *value) const char *p = value; while (*p) { - if (!isascii (*p++)) + if (!g_ascii_isprint (*p++)) return FALSE; } return TRUE; @@ -462,7 +461,7 @@ create_ip4_block (gchar * ip) iblock->ip = tmp_ip4_addr.s_addr; prefix = ip_mask[1]; i = 0; - while (i < length && isdigit (prefix[i])) + while (i < length && g_ascii_isdigit (prefix[i])) i++; prefix[i] = '\0'; iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32) |