daemon: be strict at parsing parameters --[no-]informative-errors
PATCH 1/1 daemon: be strict at parsing parameters --[no-]informative-errors
Use strcmp() instead of starts_with() to stop accepting --informative-errors-just-a-little
Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>
--- daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
daemon.c +2 -2
@@ -1278,11 +1278,11 @@ int main(int argc, char **argv)make_service_overridable (arg +18 ,0 );continue ; } -if (starts_with (arg,"--informative-errors" )) { +if (!strcmp (arg,"--informative-errors" )) { informative_errors =1 ;continue ; } -if (starts_with (arg,"--no-informative-errors" )) { +if (!strcmp (arg,"--no-informative-errors" )) { informative_errors =0 ;continue ; }
Signature · 1 line
1.8.5.1.208.g019362e
Hi,
Quoted 4 lines · Nguyễn Thái Ngọc Duy
Use
strcmp()instead ofstarts_with()to stop accepting --informative-errors-just-a-littleSigned-off-by Nguyễn Thái Ngọc Duy <[email protected]>
Good catch. When this use of prefixcmp was introduced in v1.7.8-rc0~28^2 (daemon: give friendlier error messages to clients, 2011-10-14) I think it was just a typo.
Reviewed-by Jonathan Nieder <[email protected]>