From 753fdf150d743b514344da757b18fbc84534852b Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Tue, 13 Aug 2019 16:09:58 -0700 Subject: [PATCH] encoder: Fix warnings in host build Fixes a warning on unused fgets return value Test: Build on host Bug: 139380252 Change-Id: I80ce9359902ae5f8377e0b4e8b55300749793423 --- test/encoder/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/encoder/main.c b/test/encoder/main.c index bc25e8d..15261df 100644 --- a/test/encoder/main.c +++ b/test/encoder/main.c @@ -846,12 +846,14 @@ void read_cfg_file(app_ctxt_t *ps_app_ctxt, FILE *fp_cfg) while(0 == (feof(fp_cfg))) { + int ret; line[0] = '\0'; - fgets(line, STRLENGTH, fp_cfg); + if(NULL == fgets(line, sizeof(line), fp_cfg)) + break; argument[0] = '\0'; /* Reading Input File Name */ - sscanf(line, "%s %s %s", argument, value, description); - if(argument[0] == '\0') + ret = sscanf(line, "%s %s %s", argument, value, description); + if(ret < 2) continue; parse_argument(ps_app_ctxt, argument, value);