From: Tim Potter Date: Sat, 2 Apr 2005 00:56:30 +0000 (+0000) Subject: r6175: Fix crash bug and compiler warnings in strchr_m() test. Bugzilla #2565. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~4989 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17d13b57136d1f58c450d4587476304482bbd12a;p=thirdparty%2Fsamba.git r6175: Fix crash bug and compiler warnings in strchr_m() test. Bugzilla #2565. --- diff --git a/source/torture/t_strstr.c b/source/torture/t_strstr.c index 25709526fe8..7b928fb26be 100644 --- a/source/torture/t_strstr.c +++ b/source/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;