diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-09-06 00:15:23 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-09-06 00:17:01 -0700 |
commit | 1b8bf0b5477c1f6ad38a7d57cd9ef354409472d1 (patch) | |
tree | 63e3577927b695a36de485ffe3a8e5410355194a | |
parent | 1519db19e3d1ed1efc07c8c428c1e9013d93f285 (diff) |
Explicitly cast tolower() return value to char before storing in a char
For ancient historical compatibility, the C standards define the
<ctype.h> functions as taking & returning ints, but limiting them
to the subset of values that fit in a char.
Silences clang warning:
xkill.c:244:12: warning: implicit conversion loses integer precision: 'int' to
'char' [-Wconversion]
*cp = _tolower (*cp);
~ ^~~~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xkill.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -241,9 +241,9 @@ parse_button(char *s, int *buttonp) for (cp = s; *cp; cp++) { if (isascii (*cp) && isupper (*cp)) { #ifdef _tolower - *cp = _tolower (*cp); + *cp = (char) _tolower (*cp); #else - *cp = tolower (*cp); + *cp = (char) tolower (*cp); #endif /* _tolower */ } } |