From 5dae28632b05a80365ea8ebb9968c4eb2ee2b98a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 5 Apr 2016 22:34:32 +0200 Subject: examples:smbclient:testacl3: fix O3 error unused result from fgets Signed-off-by: Michael Adam Reviewed-by: Christian Ambach --- examples/libsmbclient/testacl3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/libsmbclient/testacl3.c b/examples/libsmbclient/testacl3.c index f34e273d6b7..59d9994ef39 100644 --- a/examples/libsmbclient/testacl3.c +++ b/examples/libsmbclient/testacl3.c @@ -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; -- cgit v1.2.1