git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
replace: allow memmem() with an empty string to return NULL
[samba.git]
/
lib
/
replace
/
test
/
testsuite.c
diff --git
a/lib/replace/test/testsuite.c
b/lib/replace/test/testsuite.c
index 829e9f9c1d7cf2ed63789b2b7f09d23f55265e92..46697b5f19d08fd31d623fce4fba20d2712713ed 100644
(file)
--- a/
lib/replace/test/testsuite.c
+++ b/
lib/replace/test/testsuite.c
@@
-1027,7
+1027,9
@@
static int test_memmem(void)
}
s = memmem("foo", 3, "", 0);
- if (strcmp(s, "foo") != 0) {
+ /* it is allowable for this to return NULL (as happens on
+ FreeBSD) */
+ if (s && strcmp(s, "foo") != 0) {
printf(__location__ ": Failed memmem\n");
return false;
}