From 7e3cb9cbe49f7ca105f284fd684ea60811d6cf7a Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Wed, 12 Jun 2019 21:37:16 +0100 Subject: [PATCH] wmail: removed hard-coded buffer size. --- wmail/src/config.c | 2 +- wmail/src/wmail.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wmail/src/config.c b/wmail/src/config.c index 023869a..e81476a 100644 --- a/wmail/src/config.c +++ b/wmail/src/config.c @@ -259,7 +259,7 @@ void ReadConfigFile( bool resetConfigStrings ) const char *id, *value; size_t len; - if( fgets( buf, 1024, f ) == NULL ) + if( fgets( buf, sizeof buf, f ) == NULL ) break; // first eliminate the trailing whitespaces diff --git a/wmail/src/wmail.c b/wmail/src/wmail.c index 6178651..24b094c 100644 --- a/wmail/src/wmail.c +++ b/wmail/src/wmail.c @@ -840,7 +840,7 @@ static void ParseMBoxFile( struct stat *fileStat ) return; } - while( fgets( buf, 1024, f ) != NULL ) + while( fgets( buf, sizeof buf, f ) != NULL ) { if( strncmp( buf, "From ", 5 ) == 0 ) { fromFound = 1; @@ -900,7 +900,7 @@ static void ParseMaildirFile( const char *fileName, unsigned long checksum, return; } - while( fgets( buf, 1024, f ) != NULL ) + while( fgets( buf, sizeof buf, f ) != NULL ) { if( strncasecmp( buf, "from: ", 6 ) == 0 ) {