Module: ngircd.git Branch: master Commit: 44926b7f9ff031c37be48b33c314e47e2f84ff9f URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=44926...
Author: Alexander Barton alex@barton.de Date: Mon Nov 12 22:39:57 2012 +0100
Add a few casts, fix compiler warnings on NetBSD 5
This fixes a few warnings of this type: XXX.c: In function 'AAA': XXX.c:YY: warning: array subscription has type 'char'
Tested on NetBSD 5.0.2 with gcc 4.1.3.
---
src/ngircd/irc-login.c | 2 +- src/tool/tool.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 5ec6162..80a6627 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -443,7 +443,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req) punctuation is allowed.*/ ptr = Req->argv[0]; while (*ptr) { - if (!isalnum(*ptr) && + if (!isalnum((int)*ptr) && *ptr != '+' && *ptr != '-' && *ptr != '.' && *ptr != '_') { Conn_Close(Client_Conn(Client), NULL, diff --git a/src/tool/tool.c b/src/tool/tool.c index eb6c131..1bb3ebe 100644 --- a/src/tool/tool.c +++ b/src/tool/tool.c @@ -84,7 +84,7 @@ ngt_UpperStr(char *String)
ptr = String; while(*ptr) { - *ptr = toupper(*ptr); + *ptr = toupper((int)*ptr); ptr++; } return String; @@ -103,7 +103,7 @@ ngt_LowerStr(char *String)
ptr = String; while(*ptr) { - *ptr = tolower(*ptr); + *ptr = tolower((int)*ptr); ptr++; } return String;