diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-11-22 00:10:46 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-11-22 00:10:46 +0100 |
commit | 5bc22db14b6ffd4cb39722a415d4cd176bb7fc0d (patch) | |
tree | ffe438dcf5f52c8e1148e1da3ca6b9fa64d9dc32 /src/history.c | |
parent | 407dc8b5e6a4db430381000256c87ba313bbed5e (diff) | |
download | ratpoison-5bc22db14b6ffd4cb39722a415d4cd176bb7fc0d.zip |
Cast char arguments to to*/is* ctype calls to unsigned char
* those functions expect an int whose value is between -1 and 255.
Cast to unsigned char so that sign extension when promoting to int
doesn't bite us.
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/history.c b/src/history.c index b48feb9..7a6cf15 100644 --- a/src/history.c +++ b/src/history.c @@ -54,9 +54,9 @@ extract_shell_part (const char *p) if (strncmp(p, "exec", 4) && strncmp(p, "verbexec", 8)) return NULL; - while( *p && !isspace(*p) ) + while (*p && !isspace ((unsigned char)*p)) p++; - while( *p && isspace(*p) ) + while (*p && isspace ((unsigned char)*p)) p++; if (*p) return p; @@ -114,7 +114,7 @@ history_add_upto (int history_id, const char *item, size_t max) struct history *h = histories + history_id; struct history_item *i; - if (item == NULL || *item == '\0' || isspace(*item)) + if (item == NULL || *item == '\0' || isspace((unsigned char)*item)) return; list_last (i, &histories[history_id].head, node); |