diff options
author | Michael Adam <obnox@samba.org> | 2016-04-05 22:50:52 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2016-05-13 00:16:17 +0200 |
commit | 49b91853c38298858cea09c0d663cd6ffab1899c (patch) | |
tree | 61bff3e8e02e3e05ebf951027b0a134d20d8897a /examples | |
parent | 2ec0ecc7a5022ff8fce9ce562cd3b41517477fcc (diff) | |
download | samba-49b91853c38298858cea09c0d663cd6ffab1899c.tar.gz |
examples:smbclient:statvfs: 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/teststatvfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/libsmbclient/teststatvfs.c b/examples/libsmbclient/teststatvfs.c index 2f656d5e645..9a8e5392763 100644 --- a/examples/libsmbclient/teststatvfs.c +++ b/examples/libsmbclient/teststatvfs.c @@ -23,7 +23,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; |