Fixed bugs reported by Purify.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@781 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2000-09-01 15:50:55 +00:00
commit 5083014aa8
3 changed files with 3 additions and 2 deletions

View file

@ -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];

View file

@ -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);

View file

@ -688,6 +688,7 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l)
Delete(returns);
Delete(tmp);
DelWrapper(f);
delete[] wname;
}
// -----------------------------------------------------------------------