Skip to content
Myr

Avoid ctype.h abuse: cast char to unsigned char first.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fix #3151

authored by riastradh · committed by GitHub · parent e2ffb53 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:src/builtin.c+1 added-1 removed
1472 unmodified lines
1473 return ret_error2(a, b, jv_string("strptime/1 only supports ISO 8601 on this platform"));1474 }1475#endif1476 const char *end = strptime(input, fmt, &tm);1477 if (end == NULL || (*end != '\0' && !isspace(*end))) {1477 if (end == NULL || (*end != '\0' && !isspace((unsigned char)*end))) {1478 return ret_error2(a, b, jv_string_fmt("date \"%s\" does not match format \"%s\"", input, fmt));1479 }1480 jv_free(b);1481 /*
431 unmodified lines
modified:src/main.c+1 added-1 removed
124 unmodified lines
125 exit(2);126}127128static int isoptish(const char* text) {129 return text[0] == '-' && (text[1] == '-' || isalpha(text[1]));129 return text[0] == '-' && (text[1] == '-' || isalpha((unsigned char)text[1]));130}131132static int isoption(const char* text, char shortopt, const char* longopt, size_t *short_opts) {133 if (text[0] != '-' || text[1] == '-')
639 unmodified lines