Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 2016 14:36:50 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295854 - head/bin/dd
Message-ID:  <201602211436.u1LEaokw063705@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Feb 21 14:36:50 2016
New Revision: 295854
URL: https://svnweb.freebsd.org/changeset/base/295854

Log:
  Make the "invalid numeric value" error message actually displayable
  (was a dead code before).
  
  Submitted by:	bde@ (earlier version)
  Reviewed by:	bde@
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/bin/dd/args.c

Modified: head/bin/dd/args.c
==============================================================================
--- head/bin/dd/args.c	Sun Feb 21 13:54:22 2016	(r295853)
+++ head/bin/dd/args.c	Sun Feb 21 14:36:50 2016	(r295854)
@@ -422,11 +422,10 @@ get_num(const char *val)
 
 	errno = 0;
 	num = strtoumax(val, &expr, 0);
-	if (errno != 0)				/* Overflow or underflow. */
-		err(1, "%s", oper);
-	
 	if (expr == val)			/* No valid digits. */
-		errx(1, "%s: illegal numeric value", oper);
+		errx(1, "%s: invalid numeric value", oper);
+	if (errno != 0)
+		err(1, "%s", oper);
 
 	mult = postfix_to_mult(*expr);
 
@@ -472,11 +471,10 @@ get_off_t(const char *val)
 
 	errno = 0;
 	num = strtoimax(val, &expr, 0);
-	if (errno != 0)				/* Overflow or underflow. */
-		err(1, "%s", oper);
-	
 	if (expr == val)			/* No valid digits. */
-		errx(1, "%s: illegal numeric value", oper);
+		errx(1, "%s: invalid numeric value", oper);
+	if (errno != 0)
+		err(1, "%s", oper);
 
 	mult = postfix_to_mult(*expr);
 



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