Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2011 21:20:08 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/162262: commit references a PR
Message-ID:  <201111062120.pA6LK8eK072187@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR misc/162262; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/162262: commit references a PR
Date: Sun,  6 Nov 2011 21:13:06 +0000 (UTC)

 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-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111062120.pA6LK8eK072187>