diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c index 87beb852860..aee98a81e1a 100644 --- a/src/boot/efi/efi-string.c +++ b/src/boot/efi/efi-string.c @@ -41,12 +41,13 @@ DEFINE_STRNLEN(char16_t, strnlen16); (_c >= 'A' && _c <= 'Z') ? _c + ('a' - 'A') : _c; \ }) -#define DEFINE_STRTOLOWER(type, name) \ - void name(type *s) { \ - if (!s) \ - return; \ - for (; *s; s++) \ - *s = TOLOWER(*s); \ +#define DEFINE_STRTOLOWER(type, name) \ + type* name(type *s) { \ + if (!s) \ + return NULL; \ + for (type *p = s; *p; p++) \ + *p = TOLOWER(*p); \ + return s; \ } DEFINE_STRTOLOWER(char, strtolower8); diff --git a/src/boot/efi/efi-string.h b/src/boot/efi/efi-string.h index c7c49a07aa3..9a0f89d904c 100644 --- a/src/boot/efi/efi-string.h +++ b/src/boot/efi/efi-string.h @@ -23,8 +23,8 @@ static inline size_t strsize16(const char16_t *s) { return s ? (strlen16(s) + 1) * sizeof(*s) : 0; } -void strtolower8(char *s); -void strtolower16(char16_t *s); +char* strtolower8(char *s); +char16_t* strtolower16(char16_t *s); int strncmp8(const char *s1, const char *s2, size_t n); int strncmp16(const char16_t *s1, const char16_t *s2, size_t n);