coredump: fix the check on the number of passed args in backtrace mode

In backtrace mode, '--backtrace' option should also be counted.
This commit is contained in:
Franck Bui 2019-06-21 16:18:39 +02:00
parent aaeb25224d
commit 2705fcd63b

View file

@ -1254,10 +1254,10 @@ static int process_backtrace(int argc, char *argv[]) {
log_debug("Processing backtrace on stdin...");
if (argc < CONTEXT_COMM + 1)
if (argc < CONTEXT_COMM + 2)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Not enough arguments passed (%i, expected %i).",
argc - 1, CONTEXT_COMM + 1 - 1);
argc - 1, CONTEXT_COMM + 2 - 1);
context[CONTEXT_PID] = argv[2 + CONTEXT_PID];
context[CONTEXT_UID] = argv[2 + CONTEXT_UID];