Commit fea9315d authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(get_created_texts): Fixed a fencepost error and two other errors, all

	introduced in rev 0.39.
parent b7bb155e
/*
* $Id: person.c,v 0.39 1998/07/26 16:45:00 ceder Exp $
* $Id: person.c,v 0.40 1998/08/09 19:55:53 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
*/
static const char *
rcsid = "$Id: person.c,v 0.39 1998/07/26 16:45:00 ceder Exp $";
rcsid = "$Id: person.c,v 0.40 1998/08/09 19:55:53 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -800,10 +800,10 @@ get_created_texts(Pers_no pers_no,
acc = access_perm(pers_no, NULL, ACTPERS, ACT_P);
if ( acc == error )
if (acc == error)
return FAILURE;
if ( acc == none )
if (acc == none)
{
err_stat = pers_no;
kom_errno = KOM_UNDEF_PERS;
......@@ -811,18 +811,21 @@ get_created_texts(Pers_no pers_no,
}
new_first = l2g_next_key(&pers_p->created_texts, 0);
if (new_first == 0)
new_first = l2g_first_appendable_key(&pers_p->created_texts);
new_first = max(new_first, first);
if (new_first >= l2g_first_appendable_key(&pers_p->created_texts))
if (first >= l2g_first_appendable_key(&pers_p->created_texts))
{
err_stat = new_first;
err_stat = first;
kom_errno = KOM_NO_SUCH_LOCAL_TEXT;
return FAILURE;
}
new_len = l2g_first_appendable_key(&pers_p->created_texts) - new_first;
new_len = min(new_len, len);
l2gi_searchsome(result, &pers_p->created_texts, new_first, new_len);
l2gi_searchsome(result, &pers_p->created_texts, new_first,
new_first + new_len);
return OK;
}
......
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