diff options
author | 2008-04-23 01:02:19 +0000 | |
---|---|---|
committer | 2008-04-23 01:02:19 +0000 | |
commit | ec20688bc65c1d791d0a62e18454c4045a25b27c (patch) | |
tree | 1e22eac4aef8afd86608220290436d1d98c23861 | |
parent | Remove kludges that map EEXIST errors too a 0 return (success) for certain (diff) | |
download | wireguard-openbsd-ec20688bc65c1d791d0a62e18454c4045a25b27c.tar.xz wireguard-openbsd-ec20688bc65c1d791d0a62e18454c4045a25b27c.zip |
Move code around to remove a warning. Clarifies the code for both
humans and compilers!
Issue pointed out by Lawrence Teo.
OK millert.
-rw-r--r-- | usr.bin/strings/strings.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/strings/strings.c b/usr.bin/strings/strings.c index eeb5cde5b68..64070a8aa36 100644 --- a/usr.bin/strings/strings.c +++ b/usr.bin/strings/strings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strings.c,v 1.12 2003/10/02 05:10:03 mickey Exp $ */ +/* $OpenBSD: strings.c,v 1.13 2008/04/23 01:02:19 ray Exp $ */ /* $NetBSD: strings.c,v 1.7 1995/02/15 15:49:19 jtc Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)strings.c 8.2 (Berkeley) 1/28/94"; #endif -static char rcsid[] = "$OpenBSD: strings.c,v 1.12 2003/10/02 05:10:03 mickey Exp $"; +static char rcsid[] = "$OpenBSD: strings.c,v 1.13 2008/04/23 01:02:19 ray Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -195,10 +195,8 @@ main(int argc, char *argv[]) hcnt = 0; } start: - for (cnt = 0; (ch = getch()) != EOF;) { + for (cnt = 0, C = bfr; (ch = getch()) != EOF;) { if (ISSTR(ch)) { - if (!cnt) - C = bfr; *C++ = ch; if (++cnt < minlen) continue; @@ -235,6 +233,7 @@ start: ; } cnt = 0; + C = bfr; } nextfile: ; } while (*argv); |