Page 1 of 1

[Nagios-devel] deletion of comments and the hashlist

Posted: Sat Jun 27, 2009 7:08 pm
by Guest
This is a multi-part message in MIME format.
--------------080406050801080707090805
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

wondering if the attached diff is valid, from what I see, if the comment
being deleted is the first in the hashlist, the hashlist is made null
without checking if the comment had other comments below it. the diff
makes the hashlist point to the next comment if this comment has others
below. I'm not sure what the side effects of this would be or how to
test a fix, any comments appreciated.

--------------080406050801080707090805
Content-Type: text/x-patch;
name="comments.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="comments.diff"

--- common/comments.c 2008-11-30 19:22:58.000000000 +0200
+++ /tmp/comments.c 2009-06-27 21:58:30.000000000 +0200
@@ -199,7 +199,10 @@
if(last_hash)
last_hash->nexthash=this_hash->nexthash;
else
- comment_hashlist[hashslot]=NULL;
+ if (this_hash->nexthash)
+ comment_hashlist[hashslot]=this_hash->nexthash;
+ else
+ comment_hashlist[hashslot]=NULL;
break;
}
last_hash=this_hash;

--------------080406050801080707090805--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]