projects
/
zilutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
11b23c1
)
[zilasm] Fix zserial parsing. Patch by Jason Self. Thanks!
author
theflash
<theflash AT sdf DOT lonestar DOT org>
Wed, 2 Sep 2015 18:14:26 +0000
(20:14 +0200)
committer
Jason Self
<j@jxself.org>
Wed, 2 Sep 2015 18:14:26 +0000
(20:14 +0200)
zilasm/main.c
patch
|
blob
|
history
diff --git
a/zilasm/main.c
b/zilasm/main.c
index 97c455863449914416a58eda9b9e4e124a2703db..d9b17b24c37648c7639ed027c98ffabc5d4f2195 100644
(file)
--- 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;
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;
}
}
{
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();
}
wrong_arg();
}