From: Michael Adam Date: Tue, 5 Apr 2016 20:57:51 +0000 (+0200) Subject: examples:smbclient:read: fix O3 error unused result of fgets X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b279aa1f7cab0dcdf8466f0bea13faa0cbabacba;p=metze%2Fsamba%2Fwip.git examples:smbclient:read: fix O3 error unused result of fgets Signed-off-by: Michael Adam Reviewed-by: Christian Ambach --- diff --git a/examples/libsmbclient/testread.c b/examples/libsmbclient/testread.c index 87625e8ca1af..e6d9bf869ab9 100644 --- a/examples/libsmbclient/testread.c +++ b/examples/libsmbclient/testread.c @@ -24,7 +24,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;