fix jrpc issue on msvc

This commit is contained in:
Lyon 2024-07-20 23:53:09 +08:00
parent 60500ff427
commit 351fd6ba62
3 changed files with 5 additions and 5 deletions

View File

@ -770,7 +770,7 @@ static char* extract_quoted_string(const char** input) {
if (!result) {
return NULL;
}
strncpy(result, start, len);
memcpy(result, start, len);
result[len] = '\0';
*input = end + 1;
return result;
@ -837,7 +837,7 @@ char* JRPC_cmd(JRPC* jrpc, const char* cmd) {
jrpc_debug("Failed to allocate memory for token_param\n");
goto __exit;
}
strncpy(token_param, start, len);
memcpy(token_param, start, len);
token_param[len] = '\0';
param = cJSON_Parse(token_param);

View File

@ -770,7 +770,7 @@ static char* extract_quoted_string(const char** input) {
if (!result) {
return NULL;
}
strncpy(result, start, len);
memcpy(result, start, len);
result[len] = '\0';
*input = end + 1;
return result;
@ -837,7 +837,7 @@ char* JRPC_cmd(JRPC* jrpc, const char* cmd) {
jrpc_debug("Failed to allocate memory for token_param\n");
goto __exit;
}
strncpy(token_param, start, len);
memcpy(token_param, start, len);
token_param[len] = '\0';
param = cJSON_Parse(token_param);

View File

@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 3
#define PIKA_EDIT_TIME "2024/07/15 17:00:25"
#define PIKA_EDIT_TIME "2024/07/20 23:52:55"