diff options
author | Warner Losh <imp@FreeBSD.org> | 2006-12-22 05:54:19 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2006-12-22 05:54:19 +0000 |
commit | 353bb0a3f8167a47aed8052415dac064ea66432d (patch) | |
tree | 854c3003905a1ec5f028884087c50401b69c1cef /usr.bin/nl | |
parent | 7e3d8842daf30780b8c97922a90748a0dcf0b2e2 (diff) | |
download | src-test2-353bb0a3f8167a47aed8052415dac064ea66432d.tar.gz src-test2-353bb0a3f8167a47aed8052415dac064ea66432d.zip |
Avoid 'bogus' uninitialized warning by initializing rather than
playing cute games. It is much simpler, clearer and easier to follow
and understand. Besides, gcc4 likes it better.
Notes
Notes:
svn path=/head/; revision=165462
Diffstat (limited to 'usr.bin/nl')
-rw-r--r-- | usr.bin/nl/nl.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c index f557185003d1..afc3c8608a2b 100644 --- a/usr.bin/nl/nl.c +++ b/usr.bin/nl/nl.c @@ -296,14 +296,11 @@ filter() int section; /* logical page section */ unsigned int adjblank; /* adjacent blank lines */ int consumed; /* intbuffer measurement */ - int donumber, idx; + int donumber = 0, idx; adjblank = 0; line = startnum; section = BODY; -#ifdef __GNUC__ - (void)&donumber; /* avoid bogus `uninitialized' warning */ -#endif while (fgets(buffer, (int)buffersize, stdin) != NULL) { for (idx = FOOTER; idx <= NP_LAST; idx++) { |