Mercurial > noffle
diff src/protocol.c @ 59:e612b263934f noffle
[svn] Changed some variable types and used some casts to avoid compiler
warnings about signedness. In general, int should be used for parameters
for allowing a signedness assertion in the function.
author | enz |
---|---|
date | Fri, 12 May 2000 17:52:41 +0100 |
parents | 125d79c9e586 |
children | 6f681d41734c |
line wrap: on
line diff
--- a/src/protocol.c Fri May 12 17:52:07 2000 +0100 +++ b/src/protocol.c Fri May 12 17:52:41 2000 +0100 @@ -1,7 +1,7 @@ /* protocol.c - $Id: protocol.c 60 2000-05-09 22:28:38Z uh1763 $ + $Id: protocol.c 65 2000-05-12 16:52:41Z enz $ */ #if HAVE_CONFIG_H @@ -76,12 +76,12 @@ if ( line[ 0 ] == '.' ) { Log_dbg( "[S] .%s", line ); - return ( fprintf( f, ".%s\r\n", line ) == strlen( line ) + 3 ); + return ( fprintf( f, ".%s\r\n", line ) == (int)strlen( line ) + 3 ); } else { Log_dbg( "[S] %s", line ); - return ( fprintf( f, "%s\r\n", line ) == strlen( line ) + 2 ); + return ( fprintf( f, "%s\r\n", line ) == (int)strlen( line ) + 2 ); } } @@ -120,7 +120,7 @@ /* Put it out raw to prevent String overflow */ Log_err( "Writing VERY long line" ); *pLn = '\0'; - if ( fprintf( f, "%s", line ) != strlen( line ) ) + if ( fprintf( f, "%s", line ) != (int)strlen( line ) ) return FALSE; pLn = line; } @@ -280,7 +280,7 @@ getDomain( domain, from ); time( &t ); strftime( date, MAXCHAR, "%Y%m%d%H%M%S", gmtime( &t ) ); - srand( time( NULL ) ); + srand( (unsigned int)time( NULL ) ); snprintf( msgId, MAXCHAR, "<%s.%X.%s@%s>", date, rand(), suffix, domain ); ASSERT( Prt_isValidMsgId( msgId ) ); }