diff mbox

[3/4] crd_read_line(): Rework code to suppress a compiler warning

Message ID 565B55C5.9040006@sandisk.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Bart Van Assche Nov. 29, 2015, 7:45 p.m. UTC
Avoid that gcc prints a warning about not checking the result of fgets().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
---
 mstdump/crd_lib/crdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/mstdump/crd_lib/crdump.c b/mstdump/crd_lib/crdump.c
index 451a944..3e3c4bc 100755
--- a/mstdump/crd_lib/crdump.c
+++ b/mstdump/crd_lib/crdump.c
@@ -504,8 +504,8 @@  static int crd_read_line(IN FILE *fd, OUT char *tmp) {
         if (!feof(fd)) {
             int c = fgetc(fd);
             if (c == '#') {
-                char* _ptr=fgets (tmp, 300, fd);
-                (void)_ptr;//avoid warning
+                if (fgets(tmp, 300, fd)) {
+                }
                 tmp[0] = 0;
                 continue;
             }