examples:smbclient:statvfs: fix O3 error unused result of fgets
authorMichael Adam <obnox@samba.org>
Tue, 5 Apr 2016 20:50:52 +0000 (22:50 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:17 +0000 (00:16 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
examples/libsmbclient/teststatvfs.c

index 2f656d5e645de799a005fb9a5914776a511ca521..9a8e5392763501b2b576825eb6aea8c4eea42250 100644 (file)
@@ -23,7 +23,11 @@ int main(int argc, char * argv[])
     {
         fprintf(stdout, "Path: ");
         *path = '\0';
-        fgets(path, sizeof(path) - 1, stdin);
+       p = fgets(path, sizeof(path) - 1, stdin);
+       if (p == NULL) {
+               fprintf(stderr, "failed to read from stdin\n");
+               return 1;
+       }
         if (strlen(path) == 0)
         {
             return 0;