projects
/
fw
/
stlink
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Only call strtoul when there is an argument that strtoul can work on
[fw/stlink]
/
flash
/
main.c
diff --git
a/flash/main.c
b/flash/main.c
index 8781941cc780a4074917e9685d5ec8ab6ede2a77..39910b63665ad388c658951ad43bf6db7639571b 100644
(file)
--- 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)
{