svn commit: r295854 - head/bin/dd

Edward Tomasz Napierala trasz at FreeBSD.org
Sun Feb 21 14:36:51 UTC 2016


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);
 


More information about the svn-src-head mailing list