#include "portab.h"
-static char UNUSED id[] = "$Id: resolve.c,v 1.4 2002/12/12 12:24:18 alex Exp $";
+static char UNUSED id[] = "$Id: resolve.c,v 1.6 2003/04/21 10:52:51 alex Exp $";
#include "imp.h"
#include <assert.h>
/* Namen aufloesen */
h = gethostbyaddr( (CHAR *)&Addr->sin_addr, sizeof( Addr->sin_addr ), AF_INET );
- if( h ) strcpy( hostname, h->h_name );
+ if( h ) strlcpy( hostname, h->h_name, sizeof( hostname ));
else
{
#ifdef h_errno
#else
Log_Resolver( LOG_WARNING, "Can't resolve address \"%s\"!", inet_ntoa( Addr->sin_addr ));
#endif
- strcpy( hostname, inet_ntoa( Addr->sin_addr ));
+ strlcpy( hostname, inet_ntoa( Addr->sin_addr ), sizeof( hostname ));
}
/* Antwort an Parent schreiben */
- if( write( w_fd, hostname, strlen( hostname ) + 1 ) != ( strlen( hostname ) + 1 ))
+ if( (size_t)write( w_fd, hostname, strlen( hostname ) + 1 ) != (size_t)( strlen( hostname ) + 1 ))
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );
if( h )
{
addr = (struct in_addr *)h->h_addr;
- strcpy( ip, inet_ntoa( *addr ));
+ strlcpy( ip, inet_ntoa( *addr ), sizeof( ip ));
}
else
{
}
/* Antwort an Parent schreiben */
- if( write( w_fd, ip, strlen( ip ) + 1 ) != ( strlen( ip ) + 1 ))
+ if( (size_t)write( w_fd, ip, strlen( ip ) + 1 ) != (size_t)( strlen( ip ) + 1 ))
{
Log_Resolver( LOG_CRIT, "Resolver: Can't write to parent: %s!", strerror( errno ));
close( w_fd );