mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
examples:smbclient:write: fix O3 error unused result of fgets
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
This commit is contained in:
parent
b279aa1f7c
commit
fb81a0b4e2
@ -22,14 +22,22 @@ int main(int argc, char * argv[])
|
||||
|
||||
printf("CAUTION: This program will overwrite a file. "
|
||||
"Press ENTER to continue.");
|
||||
fgets(buffer, sizeof(buffer), stdin);
|
||||
p = fgets(buffer, sizeof(buffer), stdin);
|
||||
if (p == NULL) {
|
||||
fprintf(stderr, "failed to read from stdin\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
fprintf(stdout, "\nPath: ");
|
||||
*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;
|
||||
|
Loading…
Reference in New Issue
Block a user