summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-04-02 00:56:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:28 -0500
commit219ad7da07b9a0277138373cfa3b2c0ff2506c52 (patch)
treecbd38927e22213ccaa724d3142c0298a036b9837
parent1045c786246658f5d8e289d46cb4bdfc87655c71 (diff)
downloadsamba-219ad7da07b9a0277138373cfa3b2c0ff2506c52.tar.gz
samba-219ad7da07b9a0277138373cfa3b2c0ff2506c52.tar.bz2
samba-219ad7da07b9a0277138373cfa3b2c0ff2506c52.zip
r6175: Fix crash bug and compiler warnings in strchr_m() test. Bugzilla #2565.
(This used to be commit 17d13b57136d1f58c450d4587476304482bbd12a)
-rw-r--r--source3/torture/t_strstr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/torture/t_strstr.c b/source3/torture/t_strstr.c
index 25709526fe..7b928fb26b 100644
--- a/source3/torture/t_strstr.c
+++ b/source3/torture/t_strstr.c
@@ -11,7 +11,7 @@ int main(int argc, char *argv[])
int i;
int iters = 1;
- char *ret;
+ const char *ret = NULL;
/* Needed to initialize character set */
lp_load("/dev/null", True, False, False);
@@ -29,6 +29,9 @@ int main(int argc, char *argv[])
ret = strstr_m(argv[1], argv[2]);
}
+ if (ret == NULL)
+ ret = "(null)";
+
printf("%s\n", ret);
return 0;