fix undefined behaviour with some ctype functions - saait - the most boring static page generator
(HTM) git clone git://git.codemadness.org/saait
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit bbeb92b4aff16a77b15252423abd24c4b2fb46ed
(DIR) parent ea16f6b7c0fe3be5f0d9ee633ea5b4438fa8b034
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 8 Sep 2018 17:53:34 +0200
fix undefined behaviour with some ctype functions
this affected NetBSD with inlined ctype functions
Diffstat:
M saait.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/saait.c b/saait.c
@@ -319,13 +319,13 @@ writepage(FILE *fp, const char *file, struct variable *c, char *s)
}
/* variable case */
- for (; *s && isspace(*s); s++)
+ for (; *s && isspace((unsigned char)*s); s++)
;
key = s;
for (keylen = 0; *s && *s != '}'; s++)
keylen++;
/* trim right whitespace */
- for (; keylen && isspace(key[keylen - 1]); )
+ for (; keylen && isspace((unsigned char)key[keylen - 1]); )
keylen--;
/* temporary NUL terminate */