diff options
Diffstat (limited to 'src/libstddjb/case_upperb.c')
-rw-r--r-- | src/libstddjb/case_upperb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstddjb/case_upperb.c b/src/libstddjb/case_upperb.c index 78ece8f..f245f4d 100644 --- a/src/libstddjb/case_upperb.c +++ b/src/libstddjb/case_upperb.c @@ -1,13 +1,14 @@ /* ISC license. */ +#include <ctype.h> + #include <skalibs/bytestr.h> void case_upperb (char *s, size_t len) { - unsigned char const d = 'a' - 'A' ; while (len--) { - if (('a' <= *s) && (*s <= 'z')) *s -= d ; - ++s ; + int c = toupper(*s) ; + *s++ = (unsigned char)c ; } } |