mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
fundamental: Move some helpers into string-util-fundamental
This commit is contained in:
committed by
Luca Boccassi
parent
f386daa054
commit
7b19627697
@@ -29,10 +29,6 @@ static inline char* strstr_ptr(const char *haystack, const char *needle) {
|
||||
return strstr(haystack, needle);
|
||||
}
|
||||
|
||||
static inline const char* strempty(const char *s) {
|
||||
return s ?: "";
|
||||
}
|
||||
|
||||
static inline const char* strnull(const char *s) {
|
||||
return s ?: "(null)";
|
||||
}
|
||||
@@ -181,13 +177,6 @@ int free_and_strndup(char **p, const char *s, size_t l);
|
||||
|
||||
bool string_is_safe(const char *p) _pure_;
|
||||
|
||||
static inline size_t strlen_ptr(const char *s) {
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
return strlen(s);
|
||||
}
|
||||
|
||||
DISABLE_WARNING_STRINGOP_TRUNCATION;
|
||||
static inline void strncpy_exact(char *buf, const char *src, size_t buf_len) {
|
||||
strncpy(buf, src, buf_len);
|
||||
|
||||
Reference in New Issue
Block a user