diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-27 13:23:28 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2023-07-28 20:55:34 +1000 |
commit | 6df5328a902cf719495ea8a07da383172e358fff (patch) | |
tree | 18e4e8a968eaaec6136da375ddc5e8037889de02 /yamltree.c | |
parent | ccf1f62d59adc933fb348b866f351824cdd00c73 (diff) | |
download | dtc-6df5328a902cf719495ea8a07da383172e358fff.zip dtc-6df5328a902cf719495ea8a07da383172e358fff.tar.gz dtc-6df5328a902cf719495ea8a07da383172e358fff.tar.bz2 |
Fix use of <ctype.h> functions
The value passed to the <ctype.h> functions shall be the value of an unsigned
char or EOF. It is implementation-defined if the char type is signed or
unsigned. Cast to unsigned char to avoid undefined behaviour on systems where
char is signed.
This cast is already present in other parts of the code base.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'yamltree.c')
-rw-r--r-- | yamltree.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -102,7 +102,7 @@ static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len) /* Make sure the entire string is in the lower 7-bit ascii range */ for (i = 0; i < len; i++) - assert(isascii(str[i])); + assert(isascii((unsigned char)str[i])); yaml_scalar_event_initialize(&event, NULL, (const yaml_char_t *)YAML_STR_TAG, (const yaml_char_t*)str, |