From 2edd0530a6d3dfc428bedc3d9628093775673389 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sat, 10 Dec 2011 17:15:48 +0100 Subject: [PATCH] Only call strtoul when there is an argument that strtoul can work on --- flash/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flash/main.c b/flash/main.c index 8781941..39910b6 100644 --- a/flash/main.c +++ b/flash/main.c @@ -48,8 +48,8 @@ static int get_opts(struct opts* o, int ac, char** av) o->devname = av[1]; i = 1; } - - o->size = strtoul(av[i + 3], NULL, 16); + if (ac > 3) + o->size = strtoul(av[i + 3], NULL, 16); } else if (strcmp(av[0], "write") == 0) { -- 2.30.2