summaryrefslogtreecommitdiffstats
path: root/fortune
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2012-10-13 20:42:56 +0000
committerdholland <dholland@NetBSD.org>2012-10-13 20:42:56 +0000
commit9dd4e8160113cfc09566aaca86552ba8831e3759 (patch)
treecec983d4271999b595b6c8790700f3dce62f9a9e /fortune
parent88ff9c0697c57951fd41e8543aacb033ef78a94f (diff)
downloadbsdgames-darwin-9dd4e8160113cfc09566aaca86552ba8831e3759.tar.gz
bsdgames-darwin-9dd4e8160113cfc09566aaca86552ba8831e3759.tar.zst
bsdgames-darwin-9dd4e8160113cfc09566aaca86552ba8831e3759.zip
Pass -Wstrict-overflow.
Diffstat (limited to 'fortune')
-rw-r--r--fortune/strfile/strfile.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fortune/strfile/strfile.c b/fortune/strfile/strfile.c
index 8e6a487a..bc6a6b7a 100644
--- a/fortune/strfile/strfile.c
+++ b/fortune/strfile/strfile.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strfile.c,v 1.34 2011/08/31 16:24:55 plunky Exp $ */
+/* $NetBSD: strfile.c,v 1.35 2012/10/13 20:42:56 dholland Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: strfile.c,v 1.34 2011/08/31 16:24:55 plunky Exp $");
+__RCSID("$NetBSD: strfile.c,v 1.35 2012/10/13 20:42:56 dholland Exp $");
#endif
#endif /* not lint */
#endif /* __NetBSD__ */
@@ -162,11 +162,12 @@ main(int ac, char **av)
{
char *sp, dc;
FILE *inf, *outf;
- off_t last_off, length, pos, *p;
- int first, cnt;
+ off_t last_off, length, pos;
+ int first;
char *nsp;
STR *fp;
static char string[257];
+ long i;
/* sanity test */
if (sizeof(uint32_t) != 4)
@@ -256,8 +257,8 @@ main(int ac, char **av)
Tbl.str_flags = h2nl(Tbl.str_flags);
(void) fwrite((char *) &Tbl, sizeof Tbl, 1, outf);
if (STORING_PTRS) {
- for (p = Seekpts, cnt = Num_pts; cnt--; ++p)
- fwrite_be_offt(*p, outf);
+ for (i = 0; i < Num_pts; i++)
+ fwrite_be_offt(Seekpts[i], outf);
}
fflush(outf);
if (ferror(outf))