From 399a6f09ff051988e2e840185ad1f7f5b8a2adce Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Sun, 18 Jun 2017 14:07:37 +0200 Subject: Fix warnings: tolower() and similar require uchar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/logging.c') diff --git a/src/logging.c b/src/logging.c index c8b86b1c..2fb06bae 100644 --- a/src/logging.c +++ b/src/logging.c @@ -847,7 +847,7 @@ const char *log_vty_command_string() char name[name_len]; for (j = 0; j < name_len; j++) - name[j] = tolower(info->cat[i].name[j]); + name[j] = tolower((unsigned char)info->cat[i].name[j]); name[name_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", name+1); @@ -869,7 +869,7 @@ const char *log_vty_command_string() char loglevel_str[loglevel_str_len]; for (j = 0; j < loglevel_str_len; j++) - loglevel_str[j] = tolower(loglevel_strs[i].str[j]); + loglevel_str[j] = tolower((unsigned char)loglevel_strs[i].str[j]); loglevel_str[loglevel_str_len-1] = '\0'; ret = snprintf(str + offset, rem, "%s|", loglevel_str); -- cgit v1.2.3