git: 9eb77afb4df1 - stable/13 - test/ptrace/scescx.c: fix printing of braces for syscalls without args

Konstantin Belousov kib at FreeBSD.org
Sun Sep 19 11:18:37 UTC 2021


The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=9eb77afb4df14160426319582e101c5b9c1f8dfb

commit 9eb77afb4df14160426319582e101c5b9c1f8dfb
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-09-16 17:23:11 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-09-19 11:18:12 +0000

    test/ptrace/scescx.c: fix printing of braces for syscalls without args
    
    (cherry picked from commit 9a8eb5db55964c2fc7aca0db5939d8300badc9ab)
---
 tools/test/ptrace/scescx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c
index 782a43d69bf4..582d1734427e 100644
--- a/tools/test/ptrace/scescx.c
+++ b/tools/test/ptrace/scescx.c
@@ -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);
 		}
 	}


More information about the dev-commits-src-all mailing list