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:
Dan Winship
2012-09-25 10:44:23 -04:00
parent 74b6b9c768
commit 6878d20ac4
26 changed files with 34 additions and 60 deletions

View File

@@ -22,7 +22,6 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <glib.h> #include <glib.h>
#include <glib-object.h> #include <glib-object.h>

View File

@@ -19,7 +19,6 @@
*/ */
#include <config.h> #include <config.h>
#include <ctype.h>
#include <string.h> #include <string.h>
#include <dbus/dbus-glib-lowlevel.h> #include <dbus/dbus-glib-lowlevel.h>
@@ -766,7 +765,7 @@ validate_identifier (const char *identifier)
/* FIXME: do complete validation here */ /* FIXME: do complete validation here */
while (p && *p) { while (p && *p) {
if (!isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.')) if (!g_ascii_isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.'))
return FALSE; return FALSE;
if ((*p == '.') && (*(p + 1) == '.')) if ((*p == '.') && (*(p + 1) == '.'))
return FALSE; return FALSE;

View File

@@ -24,7 +24,6 @@
*/ */
#include <string.h> #include <string.h>
#include <ctype.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include "nm-setting-8021x.h" #include "nm-setting-8021x.h"
#include "nm-param-spec-specialized.h" #include "nm-param-spec-specialized.h"

View File

@@ -25,7 +25,6 @@
*/ */
#include <string.h> #include <string.h>
#include <ctype.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include "nm-param-spec-specialized.h" #include "nm-param-spec-specialized.h"

View File

@@ -22,7 +22,6 @@
*/ */
#include <string.h> #include <string.h>
#include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>

View File

@@ -24,7 +24,6 @@
*/ */
#include <string.h> #include <string.h>
#include <ctype.h>
#include "nm-setting-gsm.h" #include "nm-setting-gsm.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-setting-private.h" #include "nm-setting-private.h"
@@ -306,7 +305,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
* like space ( ) and such. * like space ( ) and such.
*/ */
for (i = 0; i < apn_len; i++) { for (i = 0; i < apn_len; i++) {
if ( !isalnum (priv->apn[i]) if ( !g_ascii_isalnum (priv->apn[i])
&& (priv->apn[i] != '.') && (priv->apn[i] != '.')
&& (priv->apn[i] != '_') && (priv->apn[i] != '_')
&& (priv->apn[i] != '-')) { && (priv->apn[i] != '-')) {
@@ -349,7 +348,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
} }
for (i = 0; i < nid_len; i++) { for (i = 0; i < nid_len; i++) {
if (!isdigit (priv->network_id[i])) { if (!g_ascii_isdigit (priv->network_id[i])) {
g_set_error (error, g_set_error (error,
NM_SETTING_GSM_ERROR, NM_SETTING_GSM_ERROR,
NM_SETTING_GSM_ERROR_INVALID_PROPERTY, NM_SETTING_GSM_ERROR_INVALID_PROPERTY,

View File

@@ -24,7 +24,6 @@
*/ */
#include <string.h> #include <string.h>
#include <ctype.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <netinet/ether.h> #include <netinet/ether.h>

View File

@@ -25,7 +25,6 @@
#include <config.h> #include <config.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include "nm-setting-wireless-security.h" #include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h" #include "nm-setting-8021x.h"
@@ -704,13 +703,13 @@ verify_wep_key (const char *key, NMWepKeyType wep_type)
if (keylen == 10 || keylen == 26) { if (keylen == 10 || keylen == 26) {
/* Hex key */ /* Hex key */
for (i = 0; i < keylen; i++) { for (i = 0; i < keylen; i++) {
if (!isxdigit (key[i])) if (!g_ascii_isxdigit (key[i]))
return FALSE; return FALSE;
} }
} else if (keylen == 5 || keylen == 13) { } else if (keylen == 5 || keylen == 13) {
/* ASCII key */ /* ASCII key */
for (i = 0; i < keylen; i++) { for (i = 0; i < keylen; i++) {
if (!isascii (key[i])) if (!g_ascii_isprint (key[i]))
return FALSE; return FALSE;
} }
} else } else
@@ -739,7 +738,7 @@ verify_wpa_psk (const char *psk)
if (psklen == 64) { if (psklen == 64) {
/* Hex PSK */ /* Hex PSK */
for (i = 0; i < psklen; i++) { for (i = 0; i < psklen; i++) {
if (!isxdigit (psk[i])) if (!g_ascii_isxdigit (psk[i]))
return FALSE; return FALSE;
} }
} }

View File

@@ -25,7 +25,6 @@
*/ */
#include "config.h" #include "config.h"
#include <ctype.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -2504,11 +2503,11 @@ nm_utils_hwaddr_aton (const char *asc, int type, gpointer buffer)
while (left && *in) { while (left && *in) {
guint8 d1 = in[0], d2 = in[1]; guint8 d1 = in[0], d2 = in[1];
if (!isxdigit (d1)) if (!g_ascii_isxdigit (d1))
return NULL; return NULL;
/* If there's no leading zero (ie "aa:b:cc") then fake it */ /* If there's no leading zero (ie "aa:b:cc") then fake it */
if (d2 && isxdigit (d2)) { if (d2 && g_ascii_isxdigit (d2)) {
*out++ = (HEXVAL (d1) << 4) + HEXVAL (d2); *out++ = (HEXVAL (d1) << 4) + HEXVAL (d2);
in += 2; in += 2;
} else { } else {
@@ -2607,7 +2606,7 @@ nm_utils_iface_valid_name (const char *name)
return FALSE; return FALSE;
while (*name) { while (*name) {
if (*name == '/' || isspace (*name)) if (*name == '/' || g_ascii_isspace (*name))
return FALSE; return FALSE;
name++; name++;
} }
@@ -2632,7 +2631,7 @@ nm_utils_is_uuid (const char *str)
while (*p) { while (*p) {
if (*p == '-') if (*p == '-')
num_dashes++; num_dashes++;
else if (!isxdigit (*p)) else if (!g_ascii_isxdigit (*p))
return FALSE; return FALSE;
p++; p++;
} }

View File

@@ -24,7 +24,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
@@ -410,12 +409,12 @@ parse_subchannels (const char *subchannels, guint32 *a, guint32 *b, guint32 *c)
g_return_val_if_fail (*c == 0, FALSE); g_return_val_if_fail (*c == 0, FALSE);
/* sanity check */ /* sanity check */
if (!isxdigit (subchannels[0])) if (!g_ascii_isxdigit (subchannels[0]))
return FALSE; return FALSE;
/* Get the first channel */ /* Get the first channel */
while (*p && (*p != ',')) { while (*p && (*p != ',')) {
if (!isxdigit (*p) && (*p != '.')) if (!g_ascii_isxdigit (*p) && (*p != '.'))
return FALSE; /* Invalid chars */ return FALSE; /* Invalid chars */
if (i >= BUFSIZE) if (i >= BUFSIZE)
return FALSE; /* Too long to be a subchannel */ return FALSE; /* Too long to be a subchannel */

View File

@@ -18,7 +18,6 @@
*/ */
#include <config.h> #include <config.h>
#include <ctype.h>
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
@@ -886,7 +885,7 @@ ip4_process_classless_routes (GHashTable *options,
p = str; p = str;
while (*p) { while (*p) {
if (!isdigit (*p) && (*p != ' ') && (*p != '.') && (*p != '/')) { if (!g_ascii_isdigit (*p) && (*p != ' ') && (*p != '.') && (*p != '/')) {
nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str); nm_log_warn (LOGD_DHCP4, "ignoring invalid classless static routes '%s'", str);
return FALSE; return FALSE;
} }

View File

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

View File

@@ -32,7 +32,6 @@
#include <stdio.h> #include <stdio.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <ctype.h>
#include <config.h> #include <config.h>

View File

@@ -23,7 +23,6 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <ctype.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <glib.h> #include <glib.h>
@@ -107,7 +106,7 @@ hostname_thread_worker (gpointer data)
nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup returned hostname '%s'", nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup returned hostname '%s'",
ht, ht->hostname); ht, ht->hostname);
for (i = 0; i < strlen (ht->hostname); i++) for (i = 0; i < strlen (ht->hostname); i++)
ht->hostname[i] = tolower (ht->hostname[i]); ht->hostname[i] = g_ascii_tolower (ht->hostname[i]);
} else { } else {
nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup failed: (%d) %s", nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup failed: (%d) %s",
ht, ht->ret, gai_strerror (ht->ret)); ht, ht->ret, gai_strerror (ht->ret));

View File

@@ -24,7 +24,6 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <ctype.h>
#include "nm-policy.h" #include "nm-policy.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
@@ -345,7 +344,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
if (dhcp_hostname && strlen (dhcp_hostname)) { if (dhcp_hostname && strlen (dhcp_hostname)) {
/* Sanity check; strip leading spaces */ /* Sanity check; strip leading spaces */
while (*p) { while (*p) {
if (!isblank (*p++)) { if (!g_ascii_isspace (*p++)) {
_set_hostname (policy, p-1, "from DHCPv4"); _set_hostname (policy, p-1, "from DHCPv4");
return; return;
} }
@@ -364,7 +363,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
if (dhcp_hostname && strlen (dhcp_hostname)) { if (dhcp_hostname && strlen (dhcp_hostname)) {
/* Sanity check; strip leading spaces */ /* Sanity check; strip leading spaces */
while (*p) { while (*p) {
if (!isblank (*p++)) { if (!g_ascii_isspace (*p++)) {
_set_hostname (policy, p-1, "from DHCPv6"); _set_hostname (policy, p-1, "from DHCPv6");
return; return;
} }

View File

@@ -40,7 +40,6 @@
#include <resolv.h> #include <resolv.h>
#include <netdb.h> #include <netdb.h>
#include <glib.h> #include <glib.h>
#include <ctype.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/sockios.h> #include <linux/sockios.h>
#include <linux/if_bonding.h> #include <linux/if_bonding.h>

View File

@@ -20,7 +20,6 @@
#include <config.h> #include <config.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <pwd.h> #include <pwd.h>
#include <glib.h> #include <glib.h>
@@ -166,7 +165,7 @@ validate_identifier (const char *identifier, GError **error)
/* FIXME: do complete validation here */ /* FIXME: do complete validation here */
while (p && *p) { while (p && *p) {
if (!isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.')) { if (!g_ascii_isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.')) {
g_set_error (error, g_set_error (error,
NM_AGENT_MANAGER_ERROR, NM_AGENT_MANAGER_ERROR,
NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER, NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER,

View File

@@ -27,7 +27,6 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <gmodule.h> #include <gmodule.h>
#include <net/if_arp.h> #include <net/if_arp.h>
#include <pwd.h> #include <pwd.h>
@@ -596,7 +595,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error)
GObject * (*factory_func) (const char *); GObject * (*factory_func) (const char *);
/* strip leading spaces */ /* strip leading spaces */
while (isblank (*pname)) while (g_ascii_isspace (*pname))
pname++; pname++;
/* ifcfg-fedora was renamed ifcfg-rh; handle old configs here */ /* ifcfg-fedora was renamed ifcfg-rh; handle old configs here */

View File

@@ -25,7 +25,6 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <ctype.h>
#include <sys/inotify.h> #include <sys/inotify.h>
#include <errno.h> #include <errno.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -1731,7 +1730,7 @@ add_one_wep_key (shvarFile *ifcfg,
char *p = value + 2; char *p = value + 2;
while (*p) { while (*p) {
if (!isascii ((int) (*p))) { if (!g_ascii_isprint ((int) (*p))) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0, g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid ASCII WEP key."); "Invalid ASCII WEP key.");
goto out; goto out;
@@ -2029,7 +2028,7 @@ parse_wpa_psk (shvarFile *ifcfg,
if (!quoted && (strlen (psk) == 64)) { if (!quoted && (strlen (psk) == 64)) {
/* Verify the hex PSK; 64 digits */ /* Verify the hex PSK; 64 digits */
while (*p) { while (*p) {
if (!isxdigit (*p++)) { if (!g_ascii_isxdigit (*p++)) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0, g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid WPA_PSK (contains non-hexadecimal characters)"); "Invalid WPA_PSK (contains non-hexadecimal characters)");
goto out; goto out;
@@ -3010,7 +3009,7 @@ make_wireless_setting (shvarFile *ifcfg,
p = value + 2; p = value + 2;
while (*p) { while (*p) {
if (!isxdigit (*p)) { if (!g_ascii_isxdigit (*p)) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0, g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)", "Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)",
value, *p); value, *p);
@@ -3281,7 +3280,7 @@ make_wired_setting (shvarFile *ifcfg,
/* basic sanity checks */ /* basic sanity checks */
while (*p) { while (*p) {
if (!isxdigit (*p) && (*p != ',') && (*p != '.')) { if (!g_ascii_isxdigit (*p) && (*p != ',') && (*p != '.')) {
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid SUBCHANNELS '%s'", value); PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid SUBCHANNELS '%s'", value);
success = FALSE; success = FALSE;
break; break;

View File

@@ -18,7 +18,6 @@
* Copyright (C) 2009 - 2012 Red Hat, Inc. * Copyright (C) 2009 - 2012 Red Hat, Inc.
*/ */
#include <ctype.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@@ -845,7 +844,7 @@ write_wireless_setting (NMConnection *connection,
* hex notation of the SSID instead. * hex notation of the SSID instead.
*/ */
for (i = 0; i < ssid->len; i++) { for (i = 0; i < ssid->len; i++) {
if (!isprint (ssid->data[i])) { if (!g_ascii_isprint (ssid->data[i])) {
hex_ssid = TRUE; hex_ssid = TRUE;
break; break;
} }

View File

@@ -26,7 +26,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <netinet/ether.h> #include <netinet/ether.h>
#include <errno.h> #include <errno.h>
#include <ctype.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <nm-setting-connection.h> #include <nm-setting-connection.h>
@@ -2291,7 +2290,7 @@ write_wireless_setting (NMConnection *connection,
* support these characters, see bug #356337) * support these characters, see bug #356337)
*/ */
for (i = 0; i < ssid->len; i++) { for (i = 0; i < ssid->len; i++) {
if (!isalnum (ssid->data[i])) { if (!g_ascii_isalnum (ssid->data[i])) {
hex_ssid = TRUE; hex_ssid = TRUE;
break; break;
} }
@@ -2953,7 +2952,7 @@ get_wireless_name (NMConnection * connection)
} }
for (i = 0; i < ssid->len; i++) { for (i = 0; i < ssid->len; i++) {
if (!isprint (ssid->data[i])) { if (!g_ascii_isprint (ssid->data[i])) {
hex_ssid = TRUE; hex_ssid = TRUE;
break; break;
} }

View File

@@ -22,7 +22,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <nm-utils.h> #include <nm-utils.h>
#include <nm-system-config-interface.h> #include <nm-system-config-interface.h>
@@ -67,7 +66,7 @@ is_hex (const char *value)
if (!p) if (!p)
return FALSE; return FALSE;
while (*p) { while (*p) {
if (!isxdigit (*p++)) if (!g_ascii_isxdigit (*p++))
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -79,7 +78,7 @@ is_ascii (const char *value)
const char *p = value; const char *p = value;
while (*p) { while (*p) {
if (!isascii (*p++)) if (!g_ascii_isprint (*p++))
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -462,7 +461,7 @@ create_ip4_block (gchar * ip)
iblock->ip = tmp_ip4_addr.s_addr; iblock->ip = tmp_ip4_addr.s_addr;
prefix = ip_mask[1]; prefix = ip_mask[1];
i = 0; i = 0;
while (i < length && isdigit (prefix[i])) while (i < length && g_ascii_isdigit (prefix[i]))
i++; i++;
prefix[i] = '\0'; prefix[i] = '\0';
iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32) iblock->netmask = nm_utils_ip4_prefix_to_netmask ((guint32)

View File

@@ -25,7 +25,6 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <ctype.h>
#include <nm-connection.h> #include <nm-connection.h>
#include <NetworkManager.h> #include <NetworkManager.h>
@@ -446,7 +445,7 @@ ifupdown_ip4_add_dns (NMSettingIP4Config *s_ip4, const char *dns)
list = g_strsplit_set (dns, " \t", -1); list = g_strsplit_set (dns, " \t", -1);
for (iter = list; iter && *iter; iter++) { for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter); g_strstrip (*iter);
if (isblank (*iter[0])) if (g_ascii_isspace (*iter[0]))
continue; continue;
if (!inet_pton (AF_INET, *iter, &addr)) { if (!inet_pton (AF_INET, *iter, &addr)) {
PLUGIN_WARN ("SCPlugin-Ifupdown", PLUGIN_WARN ("SCPlugin-Ifupdown",
@@ -552,7 +551,7 @@ update_ip4_setting_from_if_block(NMConnection *connection,
list = g_strsplit_set (search_v, " \t", -1); list = g_strsplit_set (search_v, " \t", -1);
for (iter = list; iter && *iter; iter++) { for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter); g_strstrip (*iter);
if (isblank (*iter[0])) if (g_ascii_isspace (*iter[0]))
continue; continue;
if (!nm_setting_ip4_config_add_dns_search (s_ip4, *iter)) { if (!nm_setting_ip4_config_add_dns_search (s_ip4, *iter)) {
PLUGIN_WARN ("SCPlugin-Ifupdown", PLUGIN_WARN ("SCPlugin-Ifupdown",
@@ -585,7 +584,7 @@ ifupdown_ip6_add_dns (NMSettingIP6Config *s_ip6, const char *dns)
list = g_strsplit_set (dns, " \t", -1); list = g_strsplit_set (dns, " \t", -1);
for (iter = list; iter && *iter; iter++) { for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter); g_strstrip (*iter);
if (isblank (*iter[0])) if (g_ascii_isspace (*iter[0]))
continue; continue;
if (!inet_pton (AF_INET6, *iter, &addr)) { if (!inet_pton (AF_INET6, *iter, &addr)) {
PLUGIN_WARN ("SCPlugin-Ifupdown", PLUGIN_WARN ("SCPlugin-Ifupdown",

View File

@@ -39,7 +39,6 @@
#include <netinet/ether.h> #include <netinet/ether.h>
#include <linux/if_infiniband.h> #include <linux/if_infiniband.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "nm-dbus-glib-types.h" #include "nm-dbus-glib-types.h"
#include "nm-system-config-interface.h" #include "nm-system-config-interface.h"

View File

@@ -41,7 +41,6 @@
#include <string.h> #include <string.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/ether.h> #include <netinet/ether.h>
#include <ctype.h>
#include "nm-dbus-glib-types.h" #include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h" #include "nm-glib-compat.h"
@@ -500,7 +499,7 @@ ssid_writer (GKeyFile *file,
*/ */
for (i = 0; i < array->len; i++) { for (i = 0; i < array->len; i++) {
char c = array->data[i] & 0xFF; char c = array->data[i] & 0xFF;
if (!isprint (c)) { if (!g_ascii_isprint (c)) {
new_format = FALSE; new_format = FALSE;
break; break;
} }

View File

@@ -32,7 +32,6 @@
#include <config.h> #include <config.h>
#include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>