summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-04-05 22:55:01 +0200
committerMichael Adam <obnox@samba.org>2016-05-13 00:16:17 +0200
commit398bb129f5095e22cf45fdcf84b1025268c64c53 (patch)
tree662a912d6e38ac8572d93f91f55c04eb742a92cf /examples
parent49b91853c38298858cea09c0d663cd6ffab1899c (diff)
downloadsamba-398bb129f5095e22cf45fdcf84b1025268c64c53.tar.gz
examples:smbclient:fstatvfs: 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')
-rw-r--r--examples/libsmbclient/testfstatvfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/libsmbclient/testfstatvfs.c b/examples/libsmbclient/testfstatvfs.c
index 512563f3e62..b2396e3fa1b 100644
--- a/examples/libsmbclient/testfstatvfs.c
+++ b/examples/libsmbclient/testfstatvfs.c
@@ -25,7 +25,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;