1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

Feature: Added function to lowercase a string

This commit is contained in:
Philipp Schafft 2018-09-19 13:10:05 +00:00
parent 4e69f55410
commit f2c474ec63
2 changed files with 13 additions and 0 deletions

View File

@ -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;
}

View File

@ -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__ */