summaryrefslogtreecommitdiff
path: root/src/libstddjb/case_uppers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/case_uppers.c')
-rw-r--r--src/libstddjb/case_uppers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstddjb/case_uppers.c b/src/libstddjb/case_uppers.c
index da0837c..4191711 100644
--- a/src/libstddjb/case_uppers.c
+++ b/src/libstddjb/case_uppers.c
@@ -1,13 +1,14 @@
/* ISC license. */
+#include <ctype.h>
+
#include <skalibs/bytestr.h>
void case_uppers (char *s)
{
- unsigned char const d = 'a' - 'A' ;
while (*s)
{
- if (('a' <= *s) && (*s <= 'z')) *s -= d ;
- ++s ;
+ int c = toupper(*s) ;
+ *s++ = (unsigned char)c ;
}
}