From: Brian Norris Date: Wed, 1 Dec 2010 06:19:44 +0000 (-0800) Subject: nandwrite: add check for negative blockalign X-Git-Tag: v1.4.2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0d6504cadbe0ac4c898789cfc1ea1e303dbb5db0;p=mtd-utils.git nandwrite: add check for negative blockalign Includes error messages for negative blockalign, telling the user what the offending option and value were. Signed-off-by: Brian Norris Signed-off-by: Artem Bityutskiy --- diff --git a/nandwrite.c b/nandwrite.c index 5373a89..2e45136 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -218,6 +218,10 @@ static void process_options(int argc, char * const argv[]) exit(EXIT_FAILURE); } + if (blockalign < 0) + errmsg_die("Can't specify negative blockalign with option -b:" + " %d", blockalign); + argc -= optind; argv += optind;