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();
}