mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
test/ptrace/scescx.c: fix printing of braces for syscalls without args
Also do not print stray closing brace for error condition. Sponsored by: The FreeBSD Foundation MFC after: 3 days
This commit is contained in:
parent
f575573ca5
commit
9a8eb5db55
|
@ -196,16 +196,17 @@ wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo)
|
|||
(caddr_t)args, lwpinfo->pl_syscall_narg *
|
||||
sizeof(long));
|
||||
if (error == 0) {
|
||||
printf("(");
|
||||
for (i = 0; i < (int)lwpinfo->pl_syscall_narg;
|
||||
i++) {
|
||||
printf("%c%#lx", i == 0 ? '(' : ',',
|
||||
printf("%s%#lx", i == 0 ? "" : ",",
|
||||
args[i]);
|
||||
}
|
||||
printf(")");
|
||||
} else {
|
||||
fprintf(stderr, "PT_GET_SC_ARGS failed: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
printf(")");
|
||||
free(args);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue