]> granicus.if.org Git - nethack/commitdiff
followup (trunk only)
authorkeni <keni>
Sun, 15 Jun 2008 00:23:56 +0000 (00:23 +0000)
committerkeni <keni>
Sun, 15 Jun 2008 00:23:56 +0000 (00:23 +0000)
Finally found a flag combination that will complain about declarations mixed in
with other code: -ansi -pedantic.
Clean up the violations of that I just introduced and add that flag to the
Mac 10.5 hints file.  (Note that there is one warning left in unixmain.c -
it's in Mac-specific code.)

sys/unix/hints/macosx10.5
sys/unix/unixmain.c

index 9a864b6e05e132d883b8a6b6ad9013ebd220671d..aa8137e2cc1a8bb1e2fe61a5a5d3f4fb9677664d 100644 (file)
@@ -50,7 +50,7 @@ GAMEUID  = root
 GAMEGRP  = games
 
 #CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
-CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi
+CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic
 
 #
 # You shouldn't need to change anything below here.
index 308c1c35b19ff0b6f1f309887aaeb7d810ad833c..5b9b70487eeeec39c625e4545ffd8f6f05f01d70 100644 (file)
@@ -583,11 +583,13 @@ check_user_string(optstr)
 char *optstr;
 {
        struct passwd *pw = get_unix_pw();
+       int pwlen;
+       char *eop, *w;
        if(optstr[0] == '*') return TRUE;       /* allow any user */
        if(!pw) return FALSE;
-       int pwlen = strlen(pw->pw_name);
-       char *eop = eos(optstr);
-       char *w = optstr;
+       pwlen = strlen(pw->pw_name);
+       *eop = eos(optstr);
+       *w = optstr;
        while( w+pwlen <= eop ){
                if( ! *w ) break;
                if( isspace(*w) ){ w++; continue;}