summaryrefslogtreecommitdiff
path: root/examples/libsmbclient/testread.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-04-05 22:57:51 +0200
committerMichael Adam <obnox@samba.org>2016-05-13 00:16:17 +0200
commitb279aa1f7cab0dcdf8466f0bea13faa0cbabacba (patch)
tree88c051e98be4f3c6a9c53623a87c54856c2d2fc5 /examples/libsmbclient/testread.c
parent398bb129f5095e22cf45fdcf84b1025268c64c53 (diff)
downloadsamba-b279aa1f7cab0dcdf8466f0bea13faa0cbabacba.tar.gz
examples:smbclient:read: fix O3 error unused result of fgets
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
Diffstat (limited to 'examples/libsmbclient/testread.c')
-rw-r--r--examples/libsmbclient/testread.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/libsmbclient/testread.c b/examples/libsmbclient/testread.c
index 87625e8ca1a..e6d9bf869ab 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;