From 0a52f09caad3e602b3f6451695ea576b65c0399f Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 23 Sep 2024 10:00:56 -0400 Subject: [PATCH 1/3] chore: move version to version.h and bump to 0.2.0 --- packages/c/sshnpd/include/sshnpd/params.h | 1 - packages/c/sshnpd/include/sshnpd/sshnpd.h | 1 - packages/c/sshnpd/include/sshnpd/version.h | 4 ++++ packages/c/sshnpd/src/params.c | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 packages/c/sshnpd/include/sshnpd/version.h diff --git a/packages/c/sshnpd/include/sshnpd/params.h b/packages/c/sshnpd/include/sshnpd/params.h index f0869d0fa..9d814f493 100644 --- a/packages/c/sshnpd/include/sshnpd/params.h +++ b/packages/c/sshnpd/include/sshnpd/params.h @@ -1,6 +1,5 @@ #ifndef SSHNPD_PARAMS_H #define SSHNPD_PARAMS_H -#define SSHNPD_VERSION "0.1.0" #include #include diff --git a/packages/c/sshnpd/include/sshnpd/sshnpd.h b/packages/c/sshnpd/include/sshnpd/sshnpd.h index 5c0b7f8b4..0f5d4be40 100644 --- a/packages/c/sshnpd/include/sshnpd/sshnpd.h +++ b/packages/c/sshnpd/include/sshnpd/sshnpd.h @@ -2,7 +2,6 @@ #define SSHNPD_H #include -#define SSHNPD_VERSION "0.1.0" /* Windows Definitions */ #ifdef _WIN32 #define HOMEVAR "USERPROFILE" diff --git a/packages/c/sshnpd/include/sshnpd/version.h b/packages/c/sshnpd/include/sshnpd/version.h new file mode 100644 index 000000000..4837cea07 --- /dev/null +++ b/packages/c/sshnpd/include/sshnpd/version.h @@ -0,0 +1,4 @@ +#ifndef SSHNPD_VERSION_H +#define SSHNPD_VERSION_H +#define SSHNPD_VERSION "0.2.0" +#endif diff --git a/packages/c/sshnpd/src/params.c b/packages/c/sshnpd/src/params.c index 876b563c8..dde20d48c 100644 --- a/packages/c/sshnpd/src/params.c +++ b/packages/c/sshnpd/src/params.c @@ -1,4 +1,5 @@ #include +#include #include #include #include From 425b479a6bd4aa32a4dbec2f65f22e83bac5391b Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 23 Sep 2024 10:07:54 -0400 Subject: [PATCH 2/3] fix: build errors --- packages/c/srv/src/srv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/c/srv/src/srv.c b/packages/c/srv/src/srv.c index 11f560d43..1b7a3b70a 100644 --- a/packages/c/srv/src/srv.c +++ b/packages/c/srv/src/srv.c @@ -139,7 +139,7 @@ int run_srv_daemon_side_multi(srv_params_t *params) { len = res; } - if (&control_side.transformer != NULL) { + if (control_side.transformer != NULL) { unsigned char *output = malloc(4096 * sizeof(unsigned char)); if (output == NULL) { goto exit; @@ -160,7 +160,7 @@ int run_srv_daemon_side_multi(srv_params_t *params) { // First, check if the buffer contains just one or more requests size_t nrequests = 0; - res = process_multiple_requests(buffer, &requests, &nrequests); + res = process_multiple_requests((char *)buffer, &requests, &nrequests); if (res != 0) { atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_DEBUG, "Failed to find any request from: %s\n", buffer); goto exit; @@ -445,7 +445,7 @@ static int process_multiple_requests(char *original, char **requests[], size_t * char **temp_requests = NULL; size_t temp_count = 0; - while (temp = strtok_r(saveptr, "\n", &saveptr)) { + while ((temp = strtok_r(saveptr, "\n", &saveptr))) { // realloc memory to save a new pointer temp_requests = realloc(temp_requests, (temp_count + 1) * sizeof(char *)); if (!temp_requests) { From 06a0d1d657310cf0254098f8259addda2f18e5a2 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Mon, 23 Sep 2024 10:08:02 -0400 Subject: [PATCH 3/3] fix: missing header declaration --- packages/c/sshnpd/src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/c/sshnpd/src/main.c b/packages/c/sshnpd/src/main.c index cd23bc2e3..8751d3f78 100644 --- a/packages/c/sshnpd/src/main.c +++ b/packages/c/sshnpd/src/main.c @@ -4,6 +4,7 @@ #include "sshnpd/handle_ssh_request.h" #include "sshnpd/handle_sshpublickey.h" #include "sshnpd/sshnpd.h" +#include "sshnpd/version.h" #include #include #include