From 64ab88d6b4d9f3e8f7ee90e10a68c656050a6d66 Mon Sep 17 00:00:00 2001 From: keni Date: Sun, 15 Jun 2008 00:23:56 +0000 Subject: [PATCH] followup (trunk only) 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 | 2 +- sys/unix/unixmain.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index 9a864b6e0..aa8137e2c 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -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. diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 308c1c35b..5b9b70487 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -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;} -- 2.40.0