mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45: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;
|
||||
}
|
||||
|
||||
char *
|
||||
safe_strdup(const char *str)
|
||||
{
|
||||
if (str == NULL)
|
||||
return NULL;
|
||||
|
||||
return strdup(str);
|
||||
}
|
||||
|
||||
|
||||
/* Key/value functions */
|
||||
struct keyval *
|
||||
|
@ -41,6 +41,8 @@ safe_atou64(const char *str, uint64_t *val);
|
||||
int
|
||||
safe_hextou64(const char *str, uint64_t *val);
|
||||
|
||||
char *
|
||||
safe_strdup(const char *str);
|
||||
|
||||
/* Key/value functions */
|
||||
struct keyval *
|
||||
|
Loading…
Reference in New Issue
Block a user