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 ) {