# HG changeset patch # User bears # Date 1045130641 0 # Node ID 994e9ab2c24f7515f1afbc217f25cab83908e0b5 # Parent 94ac4c72baf777dc13f0bc825077008650cf4ce3 [svn] * src/database.c: Accept articles with no body, substituting a body of a single empty line. Also cast a scanf parameter to remove warning. diff -r 94ac4c72baf7 -r 994e9ab2c24f ChangeLog --- a/ChangeLog Wed Feb 12 10:10:45 2003 +0000 +++ b/ChangeLog Thu Feb 13 10:04:01 2003 +0000 @@ -1,3 +1,8 @@ +Thu Feb 13 2003 Jim Hague + +* src/database.c: Accept articles with no body, substituting a body of a + single empty line. Also cast a scanf parameter to remove warning. + Wed Feb 12 2003 Jim Hague * NEWS,configure,configure.in,packages/redhat/noffle.spec: Update for 1.1.4. diff -r 94ac4c72baf7 -r 994e9ab2c24f src/database.c --- a/src/database.c Wed Feb 12 10:10:45 2003 +0000 +++ b/src/database.c Thu Feb 13 10:04:01 2003 +0000 @@ -1,7 +1,7 @@ /* database.c - $Id: database.c 414 2003-01-06 18:16:18Z bears $ + $Id: database.c 433 2003-02-13 10:04:01Z 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 @@ -146,7 +146,7 @@ return FALSE; } p = Utl_getLn( t, p ); - if ( ! p || sscanf( t, "%lu", &db.lastAccess ) != 1 ) + if ( ! p || sscanf( t, "%lu", (unsigned long *)&db.lastAccess ) != 1 ) { Log_err( "Entry in database '%s' is corrupt (lastAccess)", msgId ); return FALSE; @@ -306,8 +306,15 @@ if ( artTxt == NULL ) { - Log_err( "Article %s malformed: missing body", msgId ); - return FALSE; + /* + * This article has no body. Bereft of text it lies... + * + * I'm not completely sure how surprising the rest of + * Noffle would find a body-less article, so substitute + * an empty line. + */ + Log_inf( "Article %s malformed: missing body", msgId ); + artTxt = "\n"; } /* Read body */