summaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorKévin Redon <kredon@sysmocom.de>2019-05-23 19:00:19 +0200
committerlaforge <laforge@gnumonks.org>2019-06-13 13:49:30 +0000
commit1af2cd56248b449f4bca7e5763c27043c4a78873 (patch)
tree2113199c74e7c05060b86f0f49584d94b4271282 /src/gsm
parent274ac4dcc3c74f1ff0efcb1cee68c737bfa37044 (diff)
fix isdigit taking unsigned as input
fixes the following error warnings when cross-compiling using: ./configure --enable-static --prefix=/usr/local/arm-none-eabi --host=arm-none-eabi --enable-embedded --disable-doxygen --disable-shared --disable-pseudotalloc --enable-external-tests CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=cpp -mthumb -Os -mlong-calls -g3 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Wno-error=format" utils.c:1002:18: error: array subscript has type 'char' [-Werror=char-subscripts] 1002 | if (!isdigit(in[i])) gsm23003.c:414:34: error: array subscript has type 'char' [-Werror=char-subscripts] 414 | if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3) Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
Diffstat (limited to 'src/gsm')
-rw-r--r--src/gsm/gsm23003.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 4cc2671f..e20afcbc 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -411,7 +411,7 @@ int osmo_mnc_from_str(const char *mnc_str, uint16_t *mnc, bool *mnc_3_digits)
char *endptr;
int rc = 0;
- if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3)
+ if (!mnc_str || !isdigit((unsigned char)mnc_str[0]) || strlen(mnc_str) > 3)
return -EINVAL;
errno = 0;