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.
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "nm-dhcp-dhclient-utils.h"
|
||||
|
||||
@@ -108,7 +107,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isalnum ((*aiter)[0]))
|
||||
if (!g_ascii_isalnum ((*aiter)[0]))
|
||||
continue;
|
||||
|
||||
if ((*aiter)[strlen (*aiter) - 1] == ';') {
|
||||
@@ -147,7 +146,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
|
||||
const char *p = tmp;
|
||||
|
||||
while (*p) {
|
||||
if (!isxdigit (*p) && (*p != ':')) {
|
||||
if (!g_ascii_isxdigit (*p) && (*p != ':')) {
|
||||
is_octets = FALSE;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user