mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix unused return value error from e4836f3c
Re-introducing the fgets() call ine4836f3cthat has been removed inbf55c30triggers the "ignoring return value of fgets, declared with attribute warn_unused_result" error. The even better way is to actually use the return value and check it for non-NULL because only then we did a successful fgets call where we can use its result.
This commit is contained in:
@@ -639,9 +639,9 @@ void gnc_file_log_replay (GtkWindow *parent)
|
||||
{
|
||||
do
|
||||
{
|
||||
fgets(read_buf, sizeof(read_buf), log_file);
|
||||
read_retval = fgets(read_buf, sizeof(read_buf), log_file);
|
||||
/*DEBUG("Chunk read: %s",read_retval);*/
|
||||
if (strncmp(record_start_str, read_buf, strlen(record_start_str)) == 0) /* If a record started */
|
||||
if (read_retval && strncmp(record_start_str, read_buf, strlen(record_start_str)) == 0) /* If a record started */
|
||||
{
|
||||
process_trans_record(log_file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user