mirror of
https://github.com/i3/i3.git
synced 2026-02-04 03:15:27 +00:00
Fix ctype(3) function arguments.
Valid are unsigned char and EOF; add cast to make sure we're in the allowed range.
This commit is contained in:
committed by
Michael Stapelberg
parent
06dfce68d9
commit
49cbf9a6d6
@ -732,7 +732,7 @@ static void finish(void) {
|
||||
|
||||
/* Skip leading whitespace */
|
||||
char *walk = line;
|
||||
while (isspace(*walk) && walk < (line + len)) {
|
||||
while (isspace((unsigned char)*walk) && walk < (line + len)) {
|
||||
/* Pre-output the skipped whitespaces to keep proper indentation */
|
||||
fputc(*walk, ks_config);
|
||||
walk++;
|
||||
|
||||
@ -525,7 +525,7 @@ static void stdin_io_first_line_cb(int fd) {
|
||||
|
||||
static bool isempty(char *s) {
|
||||
while (*s != '\0') {
|
||||
if (!isspace(*s)) {
|
||||
if (!isspace((unsigned char)*s)) {
|
||||
return false;
|
||||
}
|
||||
s++;
|
||||
|
||||
@ -67,7 +67,7 @@ __attribute__((__const__)) bool rect_equals(const Rect a, const Rect b) {
|
||||
__attribute__((pure)) bool name_is_digits(const char *name) {
|
||||
/* positive integers and zero are interpreted as numbers */
|
||||
for (size_t i = 0; i < strlen(name); i++) {
|
||||
if (!isdigit(name[i])) {
|
||||
if (!isdigit((unsigned char)name[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user