]> git.armaanb.net Git - libacheam.git/blobdiff - src/libacheam/toupperw.c
Add tests, restructure repo, and add static target
[libacheam.git] / src / libacheam / toupperw.c
diff --git a/src/libacheam/toupperw.c b/src/libacheam/toupperw.c
new file mode 100644 (file)
index 0000000..99ac102
--- /dev/null
@@ -0,0 +1,15 @@
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+char *
+toupperw(char *inp)
+{
+       char *tmp = calloc(strlen(inp), sizeof(char));
+       strcpy(tmp, inp);
+       for (int i = 0; tmp[i]; i++){
+               tmp[i] = toupper(tmp[i]);
+       }
+       return tmp;
+}
+