Commit ba8cbd83 authored by Per Cederqvist's avatar Per Cederqvist

(do_create_conf): Now static.

(do_lookup): Changed type of local variables i and retsize to
	avoid warnings.  Handle overflow a little better and log warning
	messages if overflow ever occurs.
(rcsid): Added a missing const.
parent 49a92f0b
/*
* $Id: conference.c,v 0.37 1998/06/14 14:50:46 byers Exp $
* $Id: conference.c,v 0.38 1998/07/08 16:18:11 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,8 @@
* All atomic calls that deals with conferences.
*/
static char *rcsid = "$Id: conference.c,v 0.37 1998/06/14 14:50:46 byers Exp $";
static const char *
rcsid = "$Id: conference.c,v 0.38 1998/07/08 16:18:11 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -259,7 +260,7 @@ unique_name( const String name, Conf_no conf_no )
/*
* Create a conference.
*/
Conf_no
static Conf_no
do_create_conf(String name,
Pers_no creator,
Conf_no supervisor,
......@@ -669,8 +670,8 @@ do_lookup (const String name,
Bool want_persons)
{
Conf_list_old raw_match;
int i;
int retsize;
unsigned long i;
unsigned short retsize;
if ( cached_lookup_name( name, &raw_match ) != OK )
return FAILURE;
......@@ -682,7 +683,18 @@ do_lookup (const String name,
/* Don't call check access permissions here. It doesn't matter
that much if we allocate slightly too much memory. */
if (raw_match.type_of_conf[i].letter_box == want_persons)
{
retsize++;
/* i is "unsigned long", and retsize is "unsigned short".
They should probably both be "Conf_no" or
"Conf_no_iterator". This should never be a problem in
practice as long as Conf_no is a short. */
if (retsize == 0)
{
log("WNG: do_lookup: far too many matches\n");
--retsize;
}
}
}
result->conf_nos = tmp_alloc(sizeof(Conf_no) * retsize);
......
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