mirror of
https://github.com/i3/i3.git
synced 2026-02-04 07:45:39 +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 */
|
/* Skip leading whitespace */
|
||||||
char *walk = line;
|
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 */
|
/* Pre-output the skipped whitespaces to keep proper indentation */
|
||||||
fputc(*walk, ks_config);
|
fputc(*walk, ks_config);
|
||||||
walk++;
|
walk++;
|
||||||
|
|||||||
@ -525,7 +525,7 @@ static void stdin_io_first_line_cb(int fd) {
|
|||||||
|
|
||||||
static bool isempty(char *s) {
|
static bool isempty(char *s) {
|
||||||
while (*s != '\0') {
|
while (*s != '\0') {
|
||||||
if (!isspace(*s)) {
|
if (!isspace((unsigned char)*s)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
s++;
|
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) {
|
__attribute__((pure)) bool name_is_digits(const char *name) {
|
||||||
/* positive integers and zero are interpreted as numbers */
|
/* positive integers and zero are interpreted as numbers */
|
||||||
for (size_t i = 0; i < strlen(name); i++) {
|
for (size_t i = 0; i < strlen(name); i++) {
|
||||||
if (!isdigit(name[i])) {
|
if (!isdigit((unsigned char)name[i])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user