Commit f2c474ec authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Added function to lowercase a string

parent 4e69f554
......@@ -17,6 +17,7 @@
#endif
#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......@@ -1450,3 +1451,14 @@ int replace_string(char **dst, const char *src)
return 0;
}
int util_strtolower(char *str)
{
if (!str)
return -1;
for (; *str; str++)
*str = tolower(*str);
return 0;
}
......@@ -130,4 +130,5 @@ char *util_conv_string (const char *string, const char *in_charset, const char *
int get_line(FILE *file, char *buf, size_t siz);
int replace_string(char **dst, const char *src);
int util_strtolower(char *str);
#endif /* __UTIL_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment