summaryrefslogtreecommitdiff
path: root/src/libstddjb/case_upperb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/case_upperb.c')
-rw-r--r--src/libstddjb/case_upperb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstddjb/case_upperb.c b/src/libstddjb/case_upperb.c
new file mode 100644
index 0000000..54ceab4
--- /dev/null
+++ b/src/libstddjb/case_upperb.c
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#include <skalibs/bytestr.h>
+
+void case_upperb (register char *s, unsigned int len)
+{
+ register unsigned char const d = 'a' - 'A' ;
+ while (len--)
+ {
+ if (('a' <= *s) && (*s <= 'z')) *s -= d ;
+ ++s ;
+ }
+}