From: schwarze Date: Wed, 3 Jan 2018 19:12:20 +0000 (+0000) Subject: Stop "dd if=/dev/zero of=/dev/null bs=1 count=2 skip=0x7fffffffffffffff" X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=153396c3cab78351979eb570010acadde1497690;p=openbsd Stop "dd if=/dev/zero of=/dev/null bs=1 count=2 skip=0x7fffffffffffffff" from erroring out with "dd: skip: Undefined error: 0", mostly for consistency and to avoid the unidiomatic, wrong looking code. Patch from Bulat Musin . OK guenther@ millert@ --- diff --git a/bin/dd/args.c b/bin/dd/args.c index a59f320f671..6cd6de92e5d 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -1,4 +1,4 @@ -/* $OpenBSD: args.c,v 1.28 2016/08/16 16:44:55 krw Exp $ */ +/* $OpenBSD: args.c,v 1.29 2018/01/03 19:12:20 schwarze Exp $ */ /* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */ /*- @@ -406,8 +406,9 @@ get_off(char *val) off_t num, t; char *expr; + errno = 0; num = strtoll(val, &expr, 0); - if (num == LLONG_MAX) /* Overflow. */ + if (num == LLONG_MAX && errno == ERANGE) /* Overflow. */ err(1, "%s", oper); if (expr == val) /* No digits. */ errx(1, "%s: illegal numeric value", oper);