1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:utils: Move error-handling code into more suitable spot (CID 1524680)

The loop above would only exit once ‘c’ was equal to −1, and thus this
code could never be reached.

Also set ‘ok’ to false to indicate failure.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May  4 01:29:10 UTC 2023 on atb-devel-224
This commit is contained in:
Joseph Sutton 2023-04-06 10:00:00 +12:00 committed by Jeremy Allison
parent 11f3680462
commit 6752bcaf4d

View File

@ -889,14 +889,14 @@ int main(int argc, char **argv)
ok = false;
goto done;
}
}
if (c < -1) {
fprintf(stderr, "%s: %s\n",
poptBadOption(pc, POPT_BADOPTION_NOALIAS),
poptStrerror(c));
ok = true;
goto done;
if (c < -1) {
fprintf(stderr, "%s: %s\n",
poptBadOption(pc, POPT_BADOPTION_NOALIAS),
poptStrerror(c));
ok = false;
goto done;
}
}
if ((opt.send_stdout || resume || opt.outputfile) && opt.update) {