Author: ae
Date: Sun Nov  6 21:12:52 2011
New Revision: 227280
URL: http://svn.freebsd.org/changeset/base/227280

Log:
  Initialize "acc" value inside the loop to reset failed attempts.
  
  PR:           misc/162262
  MFC after:    3 days

Modified:
  head/sbin/fdisk/fdisk.c

Modified: head/sbin/fdisk/fdisk.c
==============================================================================
--- head/sbin/fdisk/fdisk.c     Sun Nov  6 21:11:22 2011        (r227279)
+++ head/sbin/fdisk/fdisk.c     Sun Nov  6 21:12:52 2011        (r227280)
@@ -922,11 +922,12 @@ ok(const char *str)
 static int
 decimal(const char *str, int *num, int deflt, uint32_t maxval)
 {
-       long long acc = 0;
+       long long acc;
        int c;
        char *cp;
 
        while (1) {
+               acc = 0;
                printf("Supply a decimal value for \"%s\" [%d] ", str, deflt);
                fflush(stdout);
                if (fgets(lbuf, LBUF, stdin) == NULL)
@@ -962,7 +963,6 @@ decimal(const char *str, int *num, int d
                        printf("%s is an invalid decimal number.  Try again.\n",
                                lbuf);
        }
-
 }
 
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to