git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
398bb12
)
examples:smbclient:read: fix O3 error unused result of fgets
author
Michael Adam
<obnox@samba.org>
Tue, 5 Apr 2016 20:57:51 +0000
(22:57 +0200)
committer
Michael Adam
<obnox@samba.org>
Thu, 12 May 2016 22:16:17 +0000
(
00:16
+0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
examples/libsmbclient/testread.c
patch
|
blob
|
history
diff --git
a/examples/libsmbclient/testread.c
b/examples/libsmbclient/testread.c
index 87625e8ca1afdb74e5e82c72a3256e5cfead4118..e6d9bf869ab9afc54c66586c27482b8caeb3d01b 100644
(file)
--- 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;