Fix for crash in DohStrstr, bug #1190921

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7204 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-05-21 00:31:30 +00:00
commit a10cfa80dd

View file

@ -1037,7 +1037,7 @@ int DohStrncmp(const DOHString_or_char *s1, const DOHString_or_char *s2, int n)
char *DohStrstr(const DOHString_or_char *s1, const DOHString_or_char *s2) {
char* p1 = Char(s1);
char* p2 = Char(s2);
return p2 == 0 || *p2 == '\0' ? p1 : strstr(p1,p2);
return p1 == 0 || p2 == 0 || *p2 == '\0' ? p1 : strstr(p1,p2);
}
char *DohStrchr(const DOHString_or_char *s1, int ch) {