git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5dae286
)
examples:smbclient:notify: fix O3 error unused result from fgets
author
Michael Adam
<obnox@samba.org>
Tue, 5 Apr 2016 20:36:34 +0000
(22:36 +0200)
committer
Michael Adam
<obnox@samba.org>
Thu, 12 May 2016 22:16:16 +0000
(
00:16
+0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
examples/libsmbclient/testnotify.c
patch
|
blob
|
history
diff --git
a/examples/libsmbclient/testnotify.c
b/examples/libsmbclient/testnotify.c
index 68513af05023d957a08663949a786267f434a7ca..8760cf0ba08aa1e39335d3bcfb388e0fdc7b76c7 100644
(file)
--- a/
examples/libsmbclient/testnotify.c
+++ b/
examples/libsmbclient/testnotify.c
@@
-43,7
+43,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, "error reading from stdin\n");
+ return 1;
+ }
if (strlen(path) == 0) {
return 0;
}