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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstddjb/case_uppers.c b/src/libstddjb/case_uppers.c
new file mode 100644
index 0000000..cf2875a
--- /dev/null
+++ b/src/libstddjb/case_uppers.c
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#include <skalibs/bytestr.h>
+
+void case_uppers (register char *s)
+{
+ register unsigned char const d = 'a' - 'A' ;
+ while (*s)
+ {
+ if (('a' <= *s) && (*s <= 'z')) *s -= d ;
+ ++s ;
+ }
+}