summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2024-04-15 21:48:43 +0800
committercgzones <cgzones@googlemail.com>2024-04-26 19:35:15 +0200
commitd2ec14fa4ab944760d3e6740d8ac3ae540dd12a0 (patch)
tree67dd84aa2a09805232cd45d4a17bd7a70655b9b1 /Settings.c
parente54871b6795ac59ee7f98ecfbec50368513d0c6f (diff)
Fix GCC build warning in NetBSD 10main
The warning message is "array subscript has type 'char' [-Wchar-subscripts]" Fix this by casting to 'unsigned char' before passing any character to a `<ctype.h>` function. Also add an assertion to RichString_writeFromAscii() to ensure the characters in the string are all in ASCII range. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Settings.c b/Settings.c
index 07b7e6a2..5913af27 100644
--- a/Settings.c
+++ b/Settings.c
@@ -233,7 +233,7 @@ static const char* toFieldName(Hashtable* columns, int id, bool* enabled) {
}
static int toFieldIndex(Hashtable* columns, const char* str) {
- if (isdigit(str[0])) {
+ if (isdigit((unsigned char)str[0])) {
// This "+1" is for compatibility with the older enum format.
int id = atoi(str) + 1;
if (toFieldName(columns, id, NULL)) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy