]> arthur.barton.de Git - ngircd.git/commitdiff
Add a few casts, fix compiler warnings on NetBSD 5
authorAlexander Barton <alex@barton.de>
Mon, 12 Nov 2012 21:39:57 +0000 (22:39 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 12 Nov 2012 21:39:57 +0000 (22:39 +0100)
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
src/tool/tool.c

index 5ec6162ca548c99024b8dad14b0297ac86b36a39..80a6627fcccf43fa91e25c730922ce5d98996122 100644 (file)
@@ -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,
index eb6c131e428462e81d3aad67075c721b429edd00..1bb3ebe698b0a6f106e09f5d1b85fea51e9f654b 100644 (file)
@@ -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;