#include "portab.h"
-static char UNUSED id[] = "$Id: conn.c,v 1.152 2005/06/04 11:49:20 fw Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.155 2005/06/26 13:43:59 alex Exp $";
#include "imp.h"
#include <assert.h>
memset( &My_Connections[Idx], 0, sizeof ( CONNECTION ));
My_Connections[Idx].sock = NONE;
- My_Connections[Idx].starttime = now;
My_Connections[Idx].lastdata = now;
My_Connections[Idx].lastprivmsg = now;
} /* Init_Conn_Struct */
#ifdef IDENTAUTH
/* clean up buffer for IDENT result */
len = strlen( s->buffer ) + 1;
- assert(len <= sizeof( s->buffer ));
+ assert((size_t)len <= sizeof( s->buffer ));
memmove( s->buffer, s->buffer + len, sizeof( s->buffer ) - len );
assert(len <= s->bufpos );
s->bufpos -= len;
LOCAL void
Simple_Message( int Sock, char *Msg )
{
+ char buf[COMMAND_LEN];
/* Write "simple" message to socket, without using compression
* or even the connection write buffers. Used e.g. for error
* messages by New_Connection(). */
-
assert( Sock > NONE );
assert( Msg != NULL );
- (void)write( Sock, Msg, strlen( Msg ) );
- (void)write( Sock, "\r\n", 2 );
+ strlcpy( buf, Msg, sizeof buf - 2);
+ strlcat( buf, "\r\n", sizeof buf);
+ (void)write( Sock, buf, strlen( buf ) );
} /* Simple_Error */