apk: isalnum() takes only unsigned char values add explicit check for that

cute-signatures
Timo Teras 2009-01-15 11:10:14 +02:00
parent 2cfde12c89
commit 4c7f1e0dec
1 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,8 @@ int main(int argc, char **argv)
}
for (opt = &generic_options[0], sopt = short_options;
opt->name != NULL; opt++) {
if (opt->flag == NULL && isalnum(opt->val)) {
if (opt->flag == NULL &&
opt->val <= 0xff && isalnum(opt->val)) {
*(sopt++) = opt->val;
if (opt->has_arg != no_argument)
*(sopt++) = ':';