Fix unused return value error from e4836f3c

Re-introducing the fgets() call in e4836f3c that has been removed in
bf55c30 triggers 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:
Christian Stimming
2019-01-20 20:39:20 +01:00
parent 020bc5371f
commit 9069bace15

View File

@@ -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);
}