projects
/
zilutils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[zilasm] Fix zserial parsing. Patch by Jason Self. Thanks!
[zilutils.git]
/
zilasm
/
main.c
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();
}