From: theflash Date: Wed, 2 Sep 2015 18:14:26 +0000 (+0200) Subject: [zilasm] Fix zserial parsing. Patch by Jason Self. Thanks! X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=1fe17d9d379f16c0f30944e7404b13423fa60439;p=zilutils.git [zilasm] Fix zserial parsing. Patch by Jason Self. Thanks! --- diff --git a/zilasm/main.c b/zilasm/main.c index 97c4558..d9b17b2 100644 --- a/zilasm/main.c +++ b/zilasm/main.c @@ -128,16 +128,17 @@ void parse_zserial(void) if (n == sizeof(Config.zserial) - 1) { char *p = optarg; - while (*p && isdigit(*p)) p++; + while (*p && isalnum(*p)) + p++; - if (!*p) /* ..optarg contains digits only? */ + if (!*p) /* ..optarg contains alphanumeric only? */ { strncpy(Config.zserial, optarg, sizeof(Config.zserial)); return; } } - fprintf(stderr, "Wrong zserial value %s, must be 6 digits in yymmdd format\n", optarg); + fprintf(stderr, "Wrong zserial value %s, must be 6 ASCII characters\n", optarg); wrong_arg(); }