mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: use spa_assert_se() for bugs in the util string functions
These are programming bugs that should never happen, so let's always abort.
This commit is contained in:
parent
40f1d2b881
commit
63d833dabf
1 changed files with 3 additions and 3 deletions
|
|
@ -73,7 +73,7 @@ static inline bool spa_strstartswith(const char *s, const char *prefix)
|
|||
if (SPA_UNLIKELY(s == NULL))
|
||||
return false;
|
||||
|
||||
spa_assert(prefix);
|
||||
spa_assert_se(prefix);
|
||||
|
||||
return strncmp(s, prefix, strlen(prefix)) == 0;
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ static inline bool spa_strendswith(const char *s, const char *suffix)
|
|||
if (SPA_UNLIKELY(s == NULL))
|
||||
return false;
|
||||
|
||||
spa_assert(suffix);
|
||||
spa_assert_se(suffix);
|
||||
|
||||
l1 = strlen(s);
|
||||
l2 = strlen(suffix);
|
||||
|
|
@ -228,7 +228,7 @@ static inline int spa_vscnprintf(char *buffer, size_t size, const char *format,
|
|||
{
|
||||
int r;
|
||||
|
||||
spa_assert((ssize_t)size > 0);
|
||||
spa_assert_se((ssize_t)size > 0);
|
||||
|
||||
r = vsnprintf(buffer, size, format, args);
|
||||
if (SPA_UNLIKELY(r < 0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue