]> www.infradead.org Git - mtd-utils.git/commitdiff
nandwrite: use common.h "errmsg_die"
authorBrian Norris <computersforpeace@gmail.com>
Wed, 1 Dec 2010 06:20:46 +0000 (22:20 -0800)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 2 Dec 2010 03:26:14 +0000 (05:26 +0200)
errmsg_die() should be nearly the equivalent of the error message used
here. This saves a few lines.

Also edited the error message to include the offending option and got
rid of the quotes.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
nandwrite.c

index 2e45136b911642734402045c0d9f08cfb79b6304..7f459cb948232763ff04a12d9fb0cd7ae61a4c05 100644 (file)
@@ -212,11 +212,9 @@ static void process_options(int argc, char * const argv[])
                }
        }
 
-       if (mtdoffset < 0) {
-               fprintf(stderr, "Can't specify a negative device offset `%lld'\n",
-                               mtdoffset);
-               exit(EXIT_FAILURE);
-       }
+       if (mtdoffset < 0)
+               errmsg_die("Can't specify negative device offset with option"
+                               " -s: %lld", mtdoffset);
 
        if (blockalign < 0)
                errmsg_die("Can't specify negative blockalign with option -b:"