mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
[misc] Helper function safe_strdup (NULL safe strdup)
This commit is contained in:
parent
4bd42dda41
commit
263edaa8b3
@ -261,6 +261,15 @@ safe_hextou64(const char *str, uint64_t *val)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
safe_strdup(const char *str)
|
||||||
|
{
|
||||||
|
if (str == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return strdup(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Key/value functions */
|
/* Key/value functions */
|
||||||
struct keyval *
|
struct keyval *
|
||||||
|
@ -41,6 +41,8 @@ safe_atou64(const char *str, uint64_t *val);
|
|||||||
int
|
int
|
||||||
safe_hextou64(const char *str, uint64_t *val);
|
safe_hextou64(const char *str, uint64_t *val);
|
||||||
|
|
||||||
|
char *
|
||||||
|
safe_strdup(const char *str);
|
||||||
|
|
||||||
/* Key/value functions */
|
/* Key/value functions */
|
||||||
struct keyval *
|
struct keyval *
|
||||||
|
Loading…
Reference in New Issue
Block a user