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

index f34e273..59d9994 100644 (file)
@@ -27,7 +27,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) {
+               printf("Error reading from stdin\n");
+               return 1;
+       }
         if (strlen(path) == 0)
         {
             return 0;