changeset 275:0880d6edaaa5 noffle

[svn] * src/client.c,src/database.h,src/database.c,src/over.h,src/over.c, src/pseudo.c,src/server.c: Ensure format string specifiers and passed data types match. As part of this, change some uses of size_t as a general data type to an appropriate base C type. Database status changes from int to unsigned.
author bears
date Sun, 10 Nov 2002 15:34:59 +0000
parents 755e03bc7dcf
children 16dad3488e9d
files src/database.c src/over.c
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/database.c	Sun Nov 10 15:24:43 2002 +0000
+++ b/src/database.c	Sun Nov 10 15:34:59 2002 +0000
@@ -1,7 +1,7 @@
 /*
   database.c
 
-  $Id: database.c 403 2002-11-10 11:32:17Z bears $
+  $Id: database.c 407 2002-11-10 15:34:59Z bears $
 
   Uses GNU gdbm library. Using Berkeley db (included in libc6) was
   cumbersome. It is based on Berkeley db 1.85, which has severe bugs
@@ -162,13 +162,13 @@
         return FALSE;
     }
     p = Utl_getHeaderLn( t, p );
-    if ( ! p || sscanf( t, "%u", &db.bytes ) != 1 )
+    if ( ! p || sscanf( t, "%lu", &db.bytes ) != 1 )
     {
         Log_err( "Entry in database '%s' is corrupt (bytes)", msgId );
         return FALSE;
     }
     p = Utl_getHeaderLn( t, p );
-    if ( ! p || sscanf( t, "%u", &db.lines ) != 1 )
+    if ( ! p || sscanf( t, "%lu", &db.lines ) != 1 )
     {
         Log_err( "Entry in database '%s' is corrupt (lines)", msgId );
         return FALSE;
@@ -197,9 +197,9 @@
     DynStr_appLn( s, db.date );
     DynStr_appLn( s, db.ref );
     DynStr_appLn( s, db.xref );
-    snprintf( t, MAXCHAR, "%u", db.bytes );
+    snprintf( t, MAXCHAR, "%lu", db.bytes );
     DynStr_appLn( s, t );
-    snprintf( t, MAXCHAR, "%u", db.lines );
+    snprintf( t, MAXCHAR, "%lu", db.lines );
     DynStr_appLn( s, t );
     DynStr_appDynStr( s, db.txt );
 
@@ -446,10 +446,10 @@
     appendLongHeader( s, "Date:", db.date );
     appendLongHeader( s, "References:", db.ref );
     DynStr_app( s, "Bytes: " );
-    snprintf( t, MAXCHAR, "%u", db.bytes );
+    snprintf( t, MAXCHAR, "%lu", db.bytes );
     DynStr_appLn( s, t );
     DynStr_app( s, "Lines: " );
-    snprintf( t, MAXCHAR, "%u", db.lines );
+    snprintf( t, MAXCHAR, "%lu", db.lines );
     DynStr_appLn( s, t );
     appendLongHeader( s, db.xrefHost, db.xref );
     p = strstr( DynStr_str( db.txt ), "\n\n" );
--- a/src/over.c	Sun Nov 10 15:24:43 2002 +0000
+++ b/src/over.c	Sun Nov 10 15:34:59 2002 +0000
@@ -1,7 +1,7 @@
 /*
   over.c
 
-  $Id: over.c 403 2002-11-10 11:32:17Z bears $
+  $Id: over.c 407 2002-11-10 15:34:59Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -165,7 +165,7 @@
     replacetabs_Over( self->date );
     replacetabs_Over( self->msgId );
     replacetabs_Over( self->ref );
-    return ( fprintf( f, "%i\t%s\t%s\t%s\t%s\t%s\t%d\t%d\n",
+    return ( fprintf( f, "%i\t%s\t%s\t%s\t%s\t%s\t%lu\t%lu\n",
                       self->numb, self->subj,
                       self->from, self->date, self->msgId,
                       self->ref, self->bytes,