summaryrefslogtreecommitdiff
path: root/examples/libsmbclient
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libsmbclient')
-rw-r--r--examples/libsmbclient/teststatvfs.c6
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;