From: Brian Norris Date: Wed, 1 Dec 2010 06:20:46 +0000 (-0800) Subject: nandwrite: use common.h "errmsg_die" X-Git-Tag: v1.4.2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f0cc488fd772934bd41c6afdbee495f20d8516df;p=mtd-utils.git nandwrite: use common.h "errmsg_die" 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 Signed-off-by: Artem Bityutskiy --- diff --git a/nandwrite.c b/nandwrite.c index 2e45136..7f459cb 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -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:"