From 0d6504cadbe0ac4c898789cfc1ea1e303dbb5db0 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 30 Nov 2010 22:19:44 -0800 Subject: 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 --- nandwrite.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3