Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/fortune/strfile Pass -Wstrict-overflow.



details:   https://anonhg.NetBSD.org/src/rev/cf170fb8f49f
branches:  trunk
changeset: 782057:cf170fb8f49f
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Oct 13 20:42:56 2012 +0000

description:
Pass -Wstrict-overflow.

diffstat:

 games/fortune/strfile/strfile.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 67d9881054e9 -r cf170fb8f49f games/fortune/strfile/strfile.c
--- a/games/fortune/strfile/strfile.c   Sat Oct 13 20:36:06 2012 +0000
+++ b/games/fortune/strfile/strfile.c   Sat Oct 13 20:42:56 2012 +0000
@@ -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 @@
 #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 @@
 {
        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 @@
        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))



Home | Main Index | Thread Index | Old Index