summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-09-25 10:44:23 -0400
committerDan Winship <danw@gnome.org>2012-09-26 12:14:37 -0400
commit6878d20ac430207b49f46c6fafe705747c02e199 (patch)
tree7e440fe71bdbff85fbd2961ddc2986fd17eba9cd
parent74b6b9c768338ce3cd58d781fd837e6abbf3e209 (diff)
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.
-rw-r--r--callouts/tests/test-dispatcher-envp.c1
-rw-r--r--libnm-glib/nm-secret-agent.c3
-rw-r--r--libnm-util/nm-setting-8021x.c1
-rw-r--r--libnm-util/nm-setting-bluetooth.c1
-rw-r--r--libnm-util/nm-setting-bond.c1
-rw-r--r--libnm-util/nm-setting-gsm.c5
-rw-r--r--libnm-util/nm-setting-wired.c1
-rw-r--r--libnm-util/nm-setting-wireless-security.c7
-rw-r--r--libnm-util/nm-utils.c9
-rw-r--r--src/NetworkManagerUtils.c5
-rw-r--r--src/dhcp-manager/nm-dhcp-client.c3
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient-utils.c5
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient.c1
-rw-r--r--src/nm-policy-hostname.c3
-rw-r--r--src/nm-policy.c5
-rw-r--r--src/nm-system.c1
-rw-r--r--src/settings/nm-agent-manager.c3
-rw-r--r--src/settings/nm-settings.c3
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c9
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c3
-rw-r--r--src/settings/plugins/ifnet/connection_parser.c5
-rw-r--r--src/settings/plugins/ifnet/net_utils.c7
-rw-r--r--src/settings/plugins/ifupdown/parser.c7
-rw-r--r--src/settings/plugins/keyfile/reader.c1
-rw-r--r--src/settings/plugins/keyfile/writer.c3
-rw-r--r--test/nm-online.c1
26 files changed, 34 insertions, 60 deletions
diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c
index 34b9dbf5..67737690 100644
--- a/callouts/tests/test-dispatcher-envp.c
+++ b/callouts/tests/test-dispatcher-envp.c
@@ -22,7 +22,6 @@
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <glib.h>
#include <glib-object.h>
diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c
index ae048d80..a43fa2cb 100644
--- a/libnm-glib/nm-secret-agent.c
+++ b/libnm-glib/nm-secret-agent.c
@@ -19,7 +19,6 @@
*/
#include <config.h>
-#include <ctype.h>
#include <string.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -766,7 +765,7 @@ validate_identifier (const char *identifier)
/* FIXME: do complete validation here */
while (p && *p) {
- if (!isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.'))
+ if (!g_ascii_isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.'))
return FALSE;
if ((*p == '.') && (*(p + 1) == '.'))
return FALSE;
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c
index 28c0d3f9..96735db2 100644
--- a/libnm-util/nm-setting-8021x.c
+++ b/libnm-util/nm-setting-8021x.c
@@ -24,7 +24,6 @@
*/
#include <string.h>
-#include <ctype.h>
#include <dbus/dbus-glib.h>
#include "nm-setting-8021x.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c
index 52f0b81e..a74e55a0 100644
--- a/libnm-util/nm-setting-bluetooth.c
+++ b/libnm-util/nm-setting-bluetooth.c
@@ -25,7 +25,6 @@
*/
#include <string.h>
-#include <ctype.h>
#include <net/ethernet.h>
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index 2cabe40c..5702713b 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -22,7 +22,6 @@
*/
#include <string.h>
-#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 98ec27a7..39529003 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -24,7 +24,6 @@
*/
#include <string.h>
-#include <ctype.h>
#include "nm-setting-gsm.h"
#include "nm-utils.h"
#include "nm-setting-private.h"
@@ -306,7 +305,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
* like space ( ) and such.
*/
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] != '-')) {
@@ -349,7 +348,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
}
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,
NM_SETTING_GSM_ERROR,
NM_SETTING_GSM_ERROR_INVALID_PROPERTY,
diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c
index fb21711d..f9efde27 100644
--- a/libnm-util/nm-setting-wired.c
+++ b/libnm-util/nm-setting-wired.c
@@ -24,7 +24,6 @@
*/
#include <string.h>
-#include <ctype.h>
#include <net/ethernet.h>
#include <dbus/dbus-glib.h>
#include <netinet/ether.h>
diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c
index 336773c8..7db2225a 100644
--- a/libnm-util/nm-setting-wireless-security.c
+++ b/libnm-util/nm-setting-wireless-security.c
@@ -25,7 +25,6 @@
#include <config.h>
#include <string.h>
-#include <ctype.h>
#include <dbus/dbus-glib.h>
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
@@ -704,13 +703,13 @@ verify_wep_key (const char *key, NMWepKeyType wep_type)
if (keylen == 10 || keylen == 26) {
/* Hex key */
for (i = 0; i < keylen; i++) {
- if (!isxdigit (key[i]))
+ if (!g_ascii_isxdigit (key[i]))
return FALSE;
}
} else if (keylen == 5 || keylen == 13) {
/* ASCII key */
for (i = 0; i < keylen; i++) {
- if (!isascii (key[i]))
+ if (!g_ascii_isprint (key[i]))
return FALSE;
}
} else
@@ -739,7 +738,7 @@ verify_wpa_psk (const char *psk)
if (psklen == 64) {
/* Hex PSK */
for (i = 0; i < psklen; i++) {
- if (!isxdigit (psk[i]))
+ if (!g_ascii_isxdigit (psk[i]))
return FALSE;
}
}
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index f88f1392..526e5655 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -25,7 +25,6 @@
*/
#include "config.h"
-#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -2504,11 +2503,11 @@ nm_utils_hwaddr_aton (const char *asc, int type, gpointer buffer)
while (left && *in) {
guint8 d1 = in[0], d2 = in[1];
- if (!isxdigit (d1))
+ if (!g_ascii_isxdigit (d1))
return NULL;
/* 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);
in += 2;
} else {
@@ -2607,7 +2606,7 @@ nm_utils_iface_valid_name (const char *name)
return FALSE;
while (*name) {
- if (*name == '/' || isspace (*name))
+ if (*name == '/' || g_ascii_isspace (*name))
return FALSE;
name++;
}
@@ -2632,7 +2631,7 @@ nm_utils_is_uuid (const char *str)
while (*p) {
if (*p == '-')
num_dashes++;
- else if (!isxdigit (*p))
+ else if (!g_ascii_isxdigit (*p))
return FALSE;
p++;
}
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index 5dcc02ff..2ea3f771 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -24,7 +24,6 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
#include <stdlib.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);
/* sanity check */
- if (!isxdigit (subchannels[0]))
+ if (!g_ascii_isxdigit (subchannels[0]))
return FALSE;
/* Get the first channel */
while (*p && (*p != ',')) {
- if (!isxdigit (*p) && (*p != '.'))
+ if (!g_ascii_isxdigit (*p) && (*p != '.'))
return FALSE; /* Invalid chars */
if (i >= BUFSIZE)
return FALSE; /* Too long to be a subchannel */
diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c
index ea4084ac..787f53d0 100644
--- a/src/dhcp-manager/nm-dhcp-client.c
+++ b/src/dhcp-manager/nm-dhcp-client.c
@@ -18,7 +18,6 @@
*/
#include <config.h>
-#include <ctype.h>
#include <glib.h>
#include <string.h>
#include <sys/types.h>
@@ -886,7 +885,7 @@ ip4_process_classless_routes (GHashTable *options,
p = str;
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);
return FALSE;
}
diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
index ab49a765..863a0976 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
@@ -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;
}
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index 043cd63d..e816c04a 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -32,7 +32,6 @@
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <ctype.h>
#include <config.h>
diff --git a/src/nm-policy-hostname.c b/src/nm-policy-hostname.c
index f98aa9c6..a788c8bc 100644
--- a/src/nm-policy-hostname.c
+++ b/src/nm-policy-hostname.c
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <errno.h>
#include <netdb.h>
-#include <ctype.h>
#include <arpa/inet.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'",
ht, ht->hostname);
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 {
nm_log_dbg (LOGD_DNS, "(%p) address reverse-lookup failed: (%d) %s",
ht, ht->ret, gai_strerror (ht->ret));
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 00cf67e2..92f771db 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -24,7 +24,6 @@
#include <unistd.h>
#include <errno.h>
#include <netdb.h>
-#include <ctype.h>
#include "nm-policy.h"
#include "NetworkManagerUtils.h"
@@ -345,7 +344,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
if (dhcp_hostname && strlen (dhcp_hostname)) {
/* Sanity check; strip leading spaces */
while (*p) {
- if (!isblank (*p++)) {
+ if (!g_ascii_isspace (*p++)) {
_set_hostname (policy, p-1, "from DHCPv4");
return;
}
@@ -364,7 +363,7 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6)
if (dhcp_hostname && strlen (dhcp_hostname)) {
/* Sanity check; strip leading spaces */
while (*p) {
- if (!isblank (*p++)) {
+ if (!g_ascii_isspace (*p++)) {
_set_hostname (policy, p-1, "from DHCPv6");
return;
}
diff --git a/src/nm-system.c b/src/nm-system.c
index bcff5092..4f422bf1 100644
--- a/src/nm-system.c
+++ b/src/nm-system.c
@@ -40,7 +40,6 @@
#include <resolv.h>
#include <netdb.h>
#include <glib.h>
-#include <ctype.h>
#include <linux/if.h>
#include <linux/sockios.h>
#include <linux/if_bonding.h>
diff --git a/src/settings/nm-agent-manager.c b/src/settings/nm-agent-manager.c
index b7057400..d9199f51 100644
--- a/src/settings/nm-agent-manager.c
+++ b/src/settings/nm-agent-manager.c
@@ -20,7 +20,6 @@
#include <config.h>
#include <string.h>
-#include <ctype.h>
#include <pwd.h>
#include <glib.h>
@@ -166,7 +165,7 @@ validate_identifier (const char *identifier, GError **error)
/* FIXME: do complete validation here */
while (p && *p) {
- if (!isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.')) {
+ if (!g_ascii_isalnum (*p) && (*p != '_') && (*p != '-') && (*p != '.')) {
g_set_error (error,
NM_AGENT_MANAGER_ERROR,
NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER,
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 1d3c74f6..0c139174 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -27,7 +27,6 @@
#include <unistd.h>
#include <string.h>
-#include <ctype.h>
#include <gmodule.h>
#include <net/if_arp.h>
#include <pwd.h>
@@ -596,7 +595,7 @@ load_plugins (NMSettings *self, const char **plugins, GError **error)
GObject * (*factory_func) (const char *);
/* strip leading spaces */
- while (isblank (*pname))
+ while (g_ascii_isspace (*pname))
pname++;
/* ifcfg-fedora was renamed ifcfg-rh; handle old configs here */
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 052d2dce..c05533c8 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -25,7 +25,6 @@
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/wait.h>
-#include <ctype.h>
#include <sys/inotify.h>
#include <errno.h>
#include <sys/ioctl.h>
@@ -1731,7 +1730,7 @@ add_one_wep_key (shvarFile *ifcfg,
char *p = value + 2;
while (*p) {
- if (!isascii ((int) (*p))) {
+ if (!g_ascii_isprint ((int) (*p))) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid ASCII WEP key.");
goto out;
@@ -2029,7 +2028,7 @@ parse_wpa_psk (shvarFile *ifcfg,
if (!quoted && (strlen (psk) == 64)) {
/* Verify the hex PSK; 64 digits */
while (*p) {
- if (!isxdigit (*p++)) {
+ if (!g_ascii_isxdigit (*p++)) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid WPA_PSK (contains non-hexadecimal characters)");
goto out;
@@ -3010,7 +3009,7 @@ make_wireless_setting (shvarFile *ifcfg,
p = value + 2;
while (*p) {
- if (!isxdigit (*p)) {
+ if (!g_ascii_isxdigit (*p)) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"Invalid SSID '%s' character (looks like hex SSID but '%c' isn't a hex digit)",
value, *p);
@@ -3281,7 +3280,7 @@ make_wired_setting (shvarFile *ifcfg,
/* basic sanity checks */
while (*p) {
- if (!isxdigit (*p) && (*p != ',') && (*p != '.')) {
+ if (!g_ascii_isxdigit (*p) && (*p != ',') && (*p != '.')) {
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: invalid SUBCHANNELS '%s'", value);
success = FALSE;
break;
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index ce0e794e..6df60238 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -18,7 +18,6 @@
* Copyright (C) 2009 - 2012 Red Hat, Inc.
*/
-#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -845,7 +844,7 @@ write_wireless_setting (NMConnection *connection,
* hex notation of the SSID instead.
*/
for (i = 0; i < ssid->len; i++) {
- if (!isprint (ssid->data[i])) {
+ if (!g_ascii_isprint (ssid->data[i])) {
hex_ssid = TRUE;
break;
}
diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c
index 78812f97..cce7f2ed 100644
--- a/src/settings/plugins/ifnet/connection_parser.c
+++ b/src/settings/plugins/ifnet/connection_parser.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <netinet/ether.h>
#include <errno.h>
-#include <ctype.h>
#include <glib/gi18n.h>
#include <nm-setting-connection.h>
@@ -2291,7 +2290,7 @@ write_wireless_setting (NMConnection *connection,
* support these characters, see bug #356337)
*/
for (i = 0; i < ssid->len; i++) {
- if (!isalnum (ssid->data[i])) {
+ if (!g_ascii_isalnum (ssid->data[i])) {
hex_ssid = TRUE;
break;
}
@@ -2953,7 +2952,7 @@ get_wireless_name (NMConnection * connection)
}
for (i = 0; i < ssid->len; i++) {
- if (!isprint (ssid->data[i])) {
+ if (!g_ascii_isprint (ssid->data[i])) {
hex_ssid = TRUE;
break;
}
diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c
index d613db6a..71949dda 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)
diff --git a/src/settings/plugins/ifupdown/parser.c b/src/settings/plugins/ifupdown/parser.c
index 88fb57b6..350a62ca 100644
--- a/src/settings/plugins/ifupdown/parser.c
+++ b/src/settings/plugins/ifupdown/parser.c
@@ -25,7 +25,6 @@
#include <arpa/inet.h>
#include <stdlib.h>
#include <errno.h>
-#include <ctype.h>
#include <nm-connection.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);
for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter);
- if (isblank (*iter[0]))
+ if (g_ascii_isspace (*iter[0]))
continue;
if (!inet_pton (AF_INET, *iter, &addr)) {
PLUGIN_WARN ("SCPlugin-Ifupdown",
@@ -552,7 +551,7 @@ update_ip4_setting_from_if_block(NMConnection *connection,
list = g_strsplit_set (search_v, " \t", -1);
for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter);
- if (isblank (*iter[0]))
+ if (g_ascii_isspace (*iter[0]))
continue;
if (!nm_setting_ip4_config_add_dns_search (s_ip4, *iter)) {
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);
for (iter = list; iter && *iter; iter++) {
g_strstrip (*iter);
- if (isblank (*iter[0]))
+ if (g_ascii_isspace (*iter[0]))
continue;
if (!inet_pton (AF_INET6, *iter, &addr)) {
PLUGIN_WARN ("SCPlugin-Ifupdown",
diff --git a/src/settings/plugins/keyfile/reader.c b/src/settings/plugins/keyfile/reader.c
index 435bdb15..df147fbe 100644
--- a/src/settings/plugins/keyfile/reader.c
+++ b/src/settings/plugins/keyfile/reader.c
@@ -39,7 +39,6 @@
#include <netinet/ether.h>
#include <linux/if_infiniband.h>
#include <string.h>
-#include <ctype.h>
#include "nm-dbus-glib-types.h"
#include "nm-system-config-interface.h"
diff --git a/src/settings/plugins/keyfile/writer.c b/src/settings/plugins/keyfile/writer.c
index 21ed6bf3..2a5ce2bd 100644
--- a/src/settings/plugins/keyfile/writer.c
+++ b/src/settings/plugins/keyfile/writer.c
@@ -41,7 +41,6 @@
#include <string.h>
#include <arpa/inet.h>
#include <netinet/ether.h>
-#include <ctype.h>
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
@@ -500,7 +499,7 @@ ssid_writer (GKeyFile *file,
*/
for (i = 0; i < array->len; i++) {
char c = array->data[i] & 0xFF;
- if (!isprint (c)) {
+ if (!g_ascii_isprint (c)) {
new_format = FALSE;
break;
}
diff --git a/test/nm-online.c b/test/nm-online.c
index 77f74638..4b3ae9a6 100644
--- a/test/nm-online.c
+++ b/test/nm-online.c
@@ -32,7 +32,6 @@
#include <config.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>