From 6b13103dad92d505e038c268af66aeb04b7b4d87 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 16 Jan 2015 16:50:23 -0300 Subject: Replace isdigit/isalpha/.../tolower/toupper with glib variants This fixes warnings about passing signed chars to them (apparently they are implemented as macros that do array lookups without checks in some platforms, yay) Specifically: functions=isalnum|isalpha|isdigit|isspace|isxdigit|tolower|toupper sed -ir "s/$functions/g_ascii_&/g" **/*.c --- nick.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nick.c') diff --git a/nick.c b/nick.c index 89ad893a..63140042 100644 --- a/nick.c +++ b/nick.c @@ -40,7 +40,7 @@ static char *clean_handle( const char *orig ) do { if (*orig != ' ') - new[i++] = tolower( *orig ); + new[i++] = g_ascii_tolower( *orig ); } while (*(orig++)); @@ -143,11 +143,11 @@ char *nick_gen( bee_user_t *bu ) } fmt += 2; } - else if( isdigit( *fmt ) ) + else if( g_ascii_isdigit( *fmt ) ) { len = 0; /* Grab a number. */ - while( isdigit( *fmt ) ) + while( g_ascii_isdigit( *fmt ) ) len = len * 10 + ( *(fmt++) - '0' ); } else if( g_strncasecmp( fmt, "nick", 4 ) == 0 ) @@ -330,7 +330,7 @@ void nick_strip( irc_t *irc, char *nick ) } } } - if( isdigit( nick[0] ) ) + if( g_ascii_isdigit( nick[0] ) ) { char *orig; @@ -350,7 +350,7 @@ gboolean nick_ok( irc_t *irc, const char *nick ) const char *s; /* Empty/long nicks are not allowed, nor numbers at [0] */ - if( !*nick || isdigit( nick[0] ) || strlen( nick ) > MAX_NICK_LENGTH ) + if( !*nick || g_ascii_isdigit( nick[0] ) || strlen( nick ) > MAX_NICK_LENGTH ) return 0; if( irc && ( irc->status & IRC_UTF8_NICKS ) ) -- cgit v1.2.3