Lineup comment and remove unnecessary whitespaces.

This commit is contained in:
enami 2002-03-04 01:40:56 +00:00
parent 1b7f309f0a
commit 96924d78ee

View File

@ -1,4 +1,4 @@
/* $NetBSD: announce.c,v 1.14 2002/03/04 01:37:52 enami Exp $ */
/* $NetBSD: announce.c,v 1.15 2002/03/04 01:40:56 enami Exp $ */
/*
* Copyright (c) 1983, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)announce.c 8.3 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: announce.c,v 1.14 2002/03/04 01:37:52 enami Exp $");
__RCSID("$NetBSD: announce.c,v 1.15 2002/03/04 01:40:56 enami Exp $");
#endif
#endif /* not lint */
@ -68,7 +68,7 @@ extern char hostname[];
*/
/*
* See if the user is accepting messages. If so, announce that
* See if the user is accepting messages. If so, announce that
* a talk is requested.
*/
int
@ -86,12 +86,12 @@ announce(request, remote_machine)
return (print_mesg(request->r_tty, request, remote_machine));
}
#define max(a,b) ( (a) > (b) ? (a) : (b) )
#define max(a, b) ((a) > (b) ? (a) : (b))
#define N_LINES 5
#define N_CHARS 256
/*
* Build a block of characters containing the message.
* Build a block of characters containing the message.
* It is sent blank filled and in a single block to
* try to keep the message in one piece if the recipient
* in in vi at the time
@ -123,15 +123,15 @@ print_mesg(tty, request, remote_machine)
max_size = max(max_size, sizes[i]);
i++;
(void)snprintf(line_buf[i], N_CHARS,
(void)snprintf(line_buf[i], N_CHARS,
"Message from Talk_Daemon@%s at %d:%02d ...",
hostname, localclock->tm_hour, localclock->tm_min );
hostname, localclock->tm_hour, localclock->tm_min);
sizes[i] = strlen(line_buf[i]);
max_size = max(max_size, sizes[i]);
i++;
vis_user = (char *)malloc(strlen(request->l_name) * 4 + 1);
strvis(vis_user, request->l_name, VIS_CSTYLE);
(void)snprintf(line_buf[i], N_CHARS,
(void)snprintf(line_buf[i], N_CHARS,
"talk: connection requested by %s@%s.", vis_user, remote_machine);
sizes[i] = strlen(line_buf[i]);
max_size = max(max_size, sizes[i]);
@ -146,8 +146,8 @@ print_mesg(tty, request, remote_machine)
max_size = max(max_size, sizes[i]);
i++;
bptr = big_buf;
*bptr++ = '\a'; /* send something to wake them up */
*bptr++ = '\r'; /* add a \r in case of raw mode */
*bptr++ = '\a'; /* send something to wake them up */
*bptr++ = '\r'; /* add a \r in case of raw mode */
*bptr++ = '\n';
for (i = 0; i < N_LINES; i++) {
/* copy the line into the big buffer */