Commit 1978cff9 authored by Per Cederqvist's avatar Per Cederqvist

(prot_a_output_person): Handle empty Local_to_global structures properly.

(prot_a_output_conference): Likewise.
(prot_a_output_conference_old): Likewise.
parent 170f5955
/*
* $Id: prot-a-output.c,v 0.35 1998/08/09 19:05:19 ceder Exp $
* $Id: prot-a-output.c,v 0.36 1998/08/22 21:31:04 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: prot-a-output.c,v 0.35 1998/08/09 19:05:19 ceder Exp $";
rcsid = "$Id: prot-a-output.c,v 0.36 1998/08/22 21:31:04 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -59,10 +59,13 @@ prot_a_output_person (Connection *fp,
Person *person)
{
Local_text_no first_created = l2g_next_key(&person->created_texts, 0);
Local_text_no uncreated = l2g_first_appendable_key(&person->created_texts);
Local_text_no num_created;
num_created = (l2g_first_appendable_key(&person->created_texts)
- first_created);
if (first_created == 0)
first_created = uncreated;
num_created = uncreated - first_created;
prot_a_output_string (fp, person->username);
prot_a_output_priv_bits (fp, person->privileges);
......@@ -228,10 +231,13 @@ prot_a_output_conference (Connection *fp,
Conference *conf_c)
{
Local_text_no first_local_no = l2g_next_key(&conf_c->texts, 0);
Local_text_no uncreated = l2g_first_appendable_key(&conf_c->texts);
Local_text_no no_of_texts;
no_of_texts = (l2g_first_appendable_key(&conf_c->texts)
- first_local_no);
if (first_local_no == 0)
first_local_no = uncreated;
no_of_texts = uncreated - first_local_no;
prot_a_output_string(fp, conf_c->name);
prot_a_output_extended_conf_type(fp, conf_c->type);
......@@ -257,10 +263,13 @@ prot_a_output_conference_old (Connection *fp,
Conference *conf_c)
{
Local_text_no first_local_no = l2g_next_key(&conf_c->texts, 0);
Local_text_no uncreated = l2g_first_appendable_key(&conf_c->texts);
Local_text_no no_of_texts;
no_of_texts = (l2g_first_appendable_key(&conf_c->texts)
- first_local_no);
if (first_local_no == 0)
first_local_no = uncreated;
no_of_texts = uncreated - first_local_no;
prot_a_output_string(fp, conf_c->name);
......
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