r6175: Fix crash bug and compiler warnings in strchr_m() test. Bugzilla #2565.
authorTim Potter <tpot@samba.org>
Sat, 2 Apr 2005 00:56:30 +0000 (00:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:28 +0000 (10:56 -0500)
source/torture/t_strstr.c

index 25709526fe84d9487f9731346de036295394eb2b..7b928fb26bea41f017526aa3c317a7866eeb7001 100644 (file)
@@ -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;