From b32a5436633f53f0abf0fa29105cf7e5b65091cf Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 29 Aug 2010 13:29:02 +0200 Subject: nandwrite: complain on malformed -s NUM Elsewhere: use common error message. -30 bytes net size change Signed-off-by: Denys Vlasenko --- miscutils/nandwrite.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'miscutils') diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c index d0e4397fb..8df0fdc81 100644 --- a/miscutils/nandwrite.c +++ b/miscutils/nandwrite.c @@ -72,6 +72,8 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv) xioctl(fd, MEMGETINFO, &meminfo); mtdoffset = bb_strtou(opt_s, NULL, 0); + if (errno) + bb_error_msg_and_die("invalid number '%s'", opt_s); /* Pull it into a CPU register (hopefully) - smaller code that way */ meminfo_writesize = meminfo.writesize; -- cgit v1.2.3