mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
core-util: Add pa_safe_streq
Like pa_streq, but does not blow up on NULL pointers. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
ae9f6dc356
commit
de5eb70032
1 changed files with 9 additions and 0 deletions
|
|
@ -208,6 +208,15 @@ void pa_unset_env_recorded(void);
|
|||
pa_bool_t pa_in_system_mode(void);
|
||||
|
||||
#define pa_streq(a,b) (!strcmp((a),(b)))
|
||||
|
||||
/* Like pa_streq, but does not blow up on NULL pointers. */
|
||||
static inline bool pa_safe_streq(const char *a, const char *b)
|
||||
{
|
||||
if (a == NULL || b == NULL)
|
||||
return a == b;
|
||||
return pa_streq(a, b);
|
||||
}
|
||||
|
||||
pa_bool_t pa_str_in_list_spaces(const char *needle, const char *haystack);
|
||||
|
||||
char *pa_get_host_name_malloc(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue