Slight change to Cmp() function to better handle null-pointers.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@697 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-08-28 04:10:53 +00:00
commit b4fe86b884

View file

@ -186,6 +186,9 @@ DohCmp(const DOH *obj1, const DOH *obj2) {
b1 = (DohBase *) obj1;
b2 = (DohBase *) obj2;
if ((!DohCheck(b1)) || (!DohCheck(b2))) {
if ((b1 == 0) && (b2 == 0)) return 0;
if (b1 && !b2) return 1;
if (!b1 && b2) return -1;
return strcmp((char *) DohData(b1),(char *) DohData(b2));
}
b1info = dohtypes[b1->type];