diff --git a/SWIG/Source/DOH/Doh/hash.c b/SWIG/Source/DOH/Doh/hash.c index 13b375675..ecf955723 100644 --- a/SWIG/Source/DOH/Doh/hash.c +++ b/SWIG/Source/DOH/Doh/hash.c @@ -297,7 +297,7 @@ hash_first(DOH *ho) { Hash *h = (Hash *) ObjData(ho); h->currentindex = 0; h->current = 0; - while (!h->hashtable[h->currentindex] && (h->currentindex < h->hashsize)) + while ((h->currentindex < h->hashsize) && !h->hashtable[h->currentindex]) h->currentindex++; if (h->currentindex >= h->hashsize) return 0; h->current = h->hashtable[h->currentindex]; diff --git a/SWIG/Source/DOH/Doh/string.c b/SWIG/Source/DOH/Doh/string.c index 8205fdb00..96d11d9a7 100644 --- a/SWIG/Source/DOH/Doh/string.c +++ b/SWIG/Source/DOH/Doh/string.c @@ -646,7 +646,7 @@ int replace_simple(String *str, char *token, char *rep, int flags, int count, ch } expand = delta*rcount; /* Total amount of expansion for the replacement */ newsize = str->maxsize; - while ((str->len + expand) > newsize) newsize *= 2; + while ((str->len + expand) >= newsize) newsize *= 2; ns = (char *) DohMalloc(newsize); assert(ns); diff --git a/SWIG/Source/Modules1.1/guile.cxx b/SWIG/Source/Modules1.1/guile.cxx index 69ce38e8e..270859e2f 100644 --- a/SWIG/Source/Modules1.1/guile.cxx +++ b/SWIG/Source/Modules1.1/guile.cxx @@ -688,6 +688,7 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l) Delete(returns); Delete(tmp); DelWrapper(f); + delete[] wname; } // -----------------------------------------------------------------------