From 1fe17d9d379f16c0f30944e7404b13423fa60439 Mon Sep 17 00:00:00 2001 From: theflash Date: Wed, 2 Sep 2015 20:14:26 +0200 Subject: [PATCH] [zilasm] Fix zserial parsing. Patch by Jason Self. Thanks! --- zilasm/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); } -- 2.31.1