mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
core-util: add pa_strneq macro
This macro compares if the given two strings, with the maximum length of n, are equal. Useful for strings that are not NULL-terminated. Reviewed-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
6e6f497219
commit
e2be9fca9c
1 changed files with 1 additions and 0 deletions
|
|
@ -219,6 +219,7 @@ void pa_unset_env_recorded(void);
|
|||
bool pa_in_system_mode(void);
|
||||
|
||||
#define pa_streq(a,b) (!strcmp((a),(b)))
|
||||
#define pa_strneq(a,b,n) (!strncmp((a),(b),(n)))
|
||||
|
||||
/* Like pa_streq, but does not blow up on NULL pointers. */
|
||||
static inline bool pa_safe_streq(const char *a, const char *b) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue