From faac51bb7f96bd6fbe4689e36d4dcafb69d81278 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 5 May 2025 14:00:20 +0200 Subject: [PATCH] proj/intercept.c: Fix some obvious bugs --- proj/intercept/src/intercept.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proj/intercept/src/intercept.c b/proj/intercept/src/intercept.c index 2964f5c..fe2a6fc 100644 --- a/proj/intercept/src/intercept.c +++ b/proj/intercept/src/intercept.c @@ -1845,7 +1845,7 @@ pid_t sym(wait)(int *stat_loc) { } const pid_t ret = __real_wait(stat_loc); if (stat_loc != NULL) { - msg("return %i; errno %s; stat=%i", ret, *stat_loc, strerrorname_np(errno)); + msg("return %i; errno %s; stat=%i", ret, strerrorname_np(errno), *stat_loc); } else { msg("return %i; errno %s", ret, strerrorname_np(errno)); } @@ -1874,7 +1874,7 @@ pid_t sym(waitpid)(pid_t pid, int *stat_loc, int options) { } const pid_t ret = __real_waitpid(pid, stat_loc, options); if (stat_loc != NULL) { - msg("return %i; errno %s; stat=%i", ret, *stat_loc, strerrorname_np(errno)); + msg("return %i; errno %s; stat=%i", ret, strerrorname_np(errno), *stat_loc); } else { msg("return %i; errno %s", ret, strerrorname_np(errno)); } @@ -1903,7 +1903,7 @@ int sym(execl)(const char *pathname, const char *arg, ...) { strcat(arg_buf_ptr, "NULL"); break; } - arg_buf_ptr += msg_str(arg_buf, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); + arg_buf_ptr += msg_str(arg_buf_ptr, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); } msg("execl(%es, %es%s)" ret_str, pathname, arg, arg_buf, ret_data); @@ -1944,7 +1944,7 @@ int sym(execlp)(const char *file, const char *arg, ...) { strcat(arg_buf_ptr, "NULL"); break; } - arg_buf_ptr += msg_str(arg_buf, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); + arg_buf_ptr += msg_str(arg_buf_ptr, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); } msg("execlp(%es, %es%s)" ret_str, file, arg, arg_buf, ret_data); @@ -1990,7 +1990,7 @@ int sym(execle)(const char *pathname, const char *arg, ...) { strcat(arg_buf_ptr, "NULL"); break; } - arg_buf_ptr += msg_str(arg_buf, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); + arg_buf_ptr += msg_str(arg_buf_ptr, sizeof(arg_buf) - (arg_buf_ptr - arg_buf), arg_vec[i], 0); } int len = 0; for (len = 0; envp[len] != NULL; len++) {} @@ -2219,7 +2219,7 @@ int sym(bind)(int sockfd, const struct sockaddr *address, socklen_t address_len) init(); Dl_info info; if (!dladdr(ret_addr, &info) || !func_flags[func_idx_bind] || !lib_flags[lib_idx]) return __real_bind(sockfd, address, address_len); - msg("socket(%i, %qa, %i)" ret_str, sockfd, address_len, address, address_len, ret_data); + msg("bind(%i, %qa, %i)" ret_str, sockfd, address_len, address, address_len, ret_data); if (mode >= 4) { char msg_buf[BUFFER_SIZE]; rcv(msg_buf, sizeof(msg_buf));