aboutsummaryrefslogtreecommitdiffstats
path: root/nick.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-01-16 16:50:23 -0300
committerdequis <dx@dxzone.com.ar>2015-01-16 16:50:23 -0300
commit6b13103dad92d505e038c268af66aeb04b7b4d87 (patch)
tree42ea01f5040065df60917daca6605318ec4f28df /nick.c
parent6f10697380c620065731a5beece95c0f5bd652a0 (diff)
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
Diffstat (limited to 'nick.c')
-rw-r--r--nick.c10
1 files changed, 5 insertions, 5 deletions
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 ) )