1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

efi: return pointer to processed string in strtolower8()/strtolower16()

This commit is contained in:
Lennart Poettering 2024-07-04 17:13:02 +02:00
parent 9afb4aea00
commit 4c4f6b9d40
2 changed files with 9 additions and 8 deletions

View File

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

View File

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