From 3c7fd1b8dc9cff602154b0a591b682938bae4227 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 26 Jun 2002 11:44:54 +0000 Subject: [PATCH] Fixed bug when deleting last message in logbook SVN revision: 156 --- elogd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/elogd.c b/elogd.c index 1765bf70..32b2dd34 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 2.32 2002/06/26 11:44:54 midas + Fixed bug when deleting last message in logbook + Revision 2.31 2002/06/25 12:08:32 midas Version 2.0.3 @@ -1615,6 +1618,8 @@ int i; return 0; } + if (*lbs->n_el_index == 0) + return 0; return lbs->el_index[0].message_id; } @@ -1628,6 +1633,8 @@ int i; return 0; } + if (*lbs->n_el_index == 0) + return 0; return lbs->el_index[*lbs->n_el_index-1].message_id; }