Commit aeff15ff authored by Per Cederqvist's avatar Per Cederqvist

(adjust_read): Fixed a fence-post error that was introduced when

Local_to_global was introduced.
parent eb720e97
/*
* $Id: membership.c,v 0.35 1998/08/22 20:46:55 ceder Exp $
* $Id: membership.c,v 0.36 1998/10/14 20:45:53 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -32,7 +32,7 @@
#define DEBUG_MARK_AS_READ
static const char *
rcsid = "$Id: membership.c,v 0.35 1998/08/22 20:46:55 ceder Exp $";
rcsid = "$Id: membership.c,v 0.36 1998/10/14 20:45:53 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -350,11 +350,11 @@ adjust_read( Membership * m,
Local_text_no prev;
#endif
/* (conf_min <= x <= conf_max) if x is an existing local_text_no */
/* (conf_min <= x < conf_max) if x is an existing local_text_no */
conf_min = l2g_next_key(&conf->texts, 0);
if (conf_min == 0)
conf_min = l2g_first_appendable_key(&conf->texts);
conf_max = l2g_first_appendable_key(&conf->texts) - 1;
conf_max = l2g_first_appendable_key(&conf->texts);
/* Flag all removed texts as read, if that is not already done. */
if (m->last_text_read < conf_min - 1)
......@@ -370,8 +370,8 @@ adjust_read( Membership * m,
/* This loops advances m->last_text_read as far as possible,
advancing handled along when appropriate. m->last_text_read
can be increased for one of two reasons:
- The text is present in read_texts.
- The text is deleted.
- The next text is present in read_texts.
- The next text is deleted.
This loop handles both cases. */
for ( ; ; )
{
......@@ -382,8 +382,8 @@ adjust_read( Membership * m,
m->last_text_read++;
handled++;
}
else if (m->last_text_read < conf_max
&& l2g_lookup(&conf->texts, m->last_text_read) == 0)
else if (m->last_text_read + 1 < conf_max
&& l2g_lookup(&conf->texts, m->last_text_read + 1) == 0)
{
/* This text is deleted. */
m->last_text_read++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment