"flash write_image (unlock|erase)" (without filename) was causing
segmentation fault in strcmp(). This patch fixes it.
Change-Id: Ia3b8c796f4107621d78605c02d2b8e123b1b207b
Reported-by: ajkroll][ <ajkroll][@irc.freenode.net>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1970
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
int retval;
- if (CMD_ARGC < 1)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
/* flash auto-erase is disabled by default*/
int auto_erase = 0;
bool auto_unlock = false;
- for (;; ) {
+ while (CMD_ARGC) {
if (strcmp(CMD_ARGV[0], "erase") == 0) {
auto_erase = 1;
CMD_ARGV++;