projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23ea433
)
* if we delete the last message, msglist[num_msgs - 1] points into an invalid area
author
Wilfried Göesgens
<willi@citadel.org>
Sun, 7 Feb 2010 12:54:27 +0000
(12:54 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Sun, 7 Feb 2010 12:54:27 +0000
(12:54 +0000)
* qrbuf.QRhighest is set to 0 if the room is empty; this will most probably fix the problems with empty rooms appearing to have unread messages.
citadel/msgbase.c
patch
|
blob
|
history
diff --git
a/citadel/msgbase.c
b/citadel/msgbase.c
index 91e8e10a16dc119e8ad8898589cebb179efae2cf..85809adb3cd477581fd109b477d1b2ac5522fe09 100644
(file)
--- a/
citadel/msgbase.c
+++ b/
citadel/msgbase.c
@@
-4225,7
+4225,10
@@
int CtdlDeleteMessages(char *room_name, /* which room */
cdb_store(CDB_MSGLISTS, &qrbuf.QRnumber, (int)sizeof(long),
msglist, (int)(num_msgs * sizeof(long)));
- qrbuf.QRhighest = msglist[num_msgs - 1];
+ if (num_msgs > 0)
+ qrbuf.QRhighest = msglist[num_msgs - 1];
+ else
+ qrbuf.QRhighest = 0;
}
CtdlPutRoomLock(&qrbuf);