summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-06-18 14:07:37 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-06-23 10:21:54 +0200
commit399a6f09ff051988e2e840185ad1f7f5b8a2adce (patch)
tree52e2ef27a1576b71c74c358bcfc5c0554df21ea0 /src/utils.c
parent4573502a1c0c84949d7195a9ea3ee8996bb29c0f (diff)
Fix warnings: tolower() and similar require uchar
utils.c: In function 'osmo_str2lower': utils.c:277:3: warning: array subscript has type 'char' [-Wchar-subscripts] out[i] = tolower(in[i]); And according to man: If c is neither an unsigned char value nor EOF, the behavior of these func‐ tions is undefined. Change-Id: I3fed2ab6a4efba9f8a21fcf84a5b3a91e8df084f
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c
index a1881f06..1c176f86 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -274,7 +274,7 @@ void osmo_str2lower(char *out, const char *in)
unsigned int i;
for (i = 0; i < strlen(in); i++)
- out[i] = tolower(in[i]);
+ out[i] = tolower((const unsigned char)in[i]);
out[strlen(in)] = '\0';
}
@@ -287,7 +287,7 @@ void osmo_str2upper(char *out, const char *in)
unsigned int i;
for (i = 0; i < strlen(in); i++)
- out[i] = toupper(in[i]);
+ out[i] = toupper((const unsigned char)in[i]);
out[strlen(in)] = '\0';
}
#endif /* HAVE_CTYPE_H */