aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2010-11-30 22:19:44 -0800
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-12-02 05:26:06 +0200
commit0d6504cadbe0ac4c898789cfc1ea1e303dbb5db0 (patch)
tree7dce96d7784a31e1d93e0fcf6690fad26598bb7b
parentac6fdbad5dfc690b6a1ddf02d3005407aa1e4846 (diff)
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 <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--nandwrite.c4
1 files changed, 4 insertions, 0 deletions
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;