core-util: Improve pa_replace() behaviour

- Assert that the search string isn't empty.
 - Add test.
 - Improve documentation.
This commit is contained in:
Ulrich Eckhardt 2016-05-16 19:51:05 +02:00 committed by Arun Raghavan
parent c9c8f4285f
commit 111e332556
3 changed files with 11 additions and 0 deletions

View file

@ -3194,6 +3194,7 @@ char *pa_replace(const char*s, const char*a, const char *b) {
pa_assert(s);
pa_assert(a);
pa_assert(*a);
pa_assert(b);
an = strlen(a);