summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-07-15 16:36:45 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-07-15 16:36:45 +0200
commitdf52acba04e85191b0fc7f10b7853fe17fb25260 (patch)
treeff8228b009dd7701a95d8fa1c2db4e7d52b51c40 /src/utils.c
parent59ccaaebf616bc0be96af3b9b8c0be6828113edc (diff)
src: add str_toupper and str_tolower functions
Add auxiliar string case change functions.
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c
index ced6470..d49a9ac 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -10,7 +10,7 @@
#include <ctype.h>
#include "utils.h"
-const char *str_toupper(char *str)
+void str_toupper(char *str)
{
char *c = str;
@@ -18,6 +18,14 @@ const char *str_toupper(char *str)
*c = toupper(*c);
c++;
}
+}
+
+void str_tolower(char *str)
+{
+ char *c = str;
- return str;
+ while (*c) {
+ *c = tolower(*c);
+ c++;
+ }
}