From: Daniel Stenberg Date: Wed, 24 May 2006 16:11:31 +0000 (+0000) Subject: minor fix to make Curl_splayremove() return a NULL as "removed" in case X-Git-Tag: curl-7_15_4~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cfd7f3fb1189fb88cdc2121e3cc5915abdd259c;p=thirdparty%2Fcurl.git minor fix to make Curl_splayremove() return a NULL as "removed" in case nothing matched fine --- diff --git a/lib/splay.c b/lib/splay.c index 0ea078b6c0..6278089d1c 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -143,6 +143,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t, { struct Curl_tree *x; + *removed = NULL; /* default to no removed */ + if (t==NULL) return NULL; @@ -174,10 +176,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t, return x; } - else { - *removed = NULL; /* no match */ + else return t; /* It wasn't there */ - } } /* Finds and deletes the best-fit node from the tree. Return a pointer to the