dutil: Add a strlwr() helper to lowercase a string, returning it

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2020-07-14 21:48:39 -03:00
parent a5bb31b86f
commit 42b7a759f3
2 changed files with 12 additions and 0 deletions

10
dutil.c
View File

@ -188,3 +188,13 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
return sec;
}
char *strlwr(char *s)
{
int len = strlen(s), i;
for (i = 0; i < len; ++i)
s[i] = tolower(s[i]);
return s;
}

View File

@ -330,4 +330,6 @@ static inline int elf_getshdrstrndx(Elf *elf, size_t *dst)
}
#endif
char *strlwr(char *s);
#endif /* _DUTIL_H_ */