mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-02-05 17:28:23 +08:00
fix jrpc issue on msvc
This commit is contained in:
parent
60500ff427
commit
351fd6ba62
@ -770,7 +770,7 @@ static char* extract_quoted_string(const char** input) {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
strncpy(result, start, len);
|
memcpy(result, start, len);
|
||||||
result[len] = '\0';
|
result[len] = '\0';
|
||||||
*input = end + 1;
|
*input = end + 1;
|
||||||
return result;
|
return result;
|
||||||
@ -837,7 +837,7 @@ char* JRPC_cmd(JRPC* jrpc, const char* cmd) {
|
|||||||
jrpc_debug("Failed to allocate memory for token_param\n");
|
jrpc_debug("Failed to allocate memory for token_param\n");
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
strncpy(token_param, start, len);
|
memcpy(token_param, start, len);
|
||||||
token_param[len] = '\0';
|
token_param[len] = '\0';
|
||||||
|
|
||||||
param = cJSON_Parse(token_param);
|
param = cJSON_Parse(token_param);
|
||||||
|
@ -770,7 +770,7 @@ static char* extract_quoted_string(const char** input) {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
strncpy(result, start, len);
|
memcpy(result, start, len);
|
||||||
result[len] = '\0';
|
result[len] = '\0';
|
||||||
*input = end + 1;
|
*input = end + 1;
|
||||||
return result;
|
return result;
|
||||||
@ -837,7 +837,7 @@ char* JRPC_cmd(JRPC* jrpc, const char* cmd) {
|
|||||||
jrpc_debug("Failed to allocate memory for token_param\n");
|
jrpc_debug("Failed to allocate memory for token_param\n");
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
strncpy(token_param, start, len);
|
memcpy(token_param, start, len);
|
||||||
token_param[len] = '\0';
|
token_param[len] = '\0';
|
||||||
|
|
||||||
param = cJSON_Parse(token_param);
|
param = cJSON_Parse(token_param);
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
#define PIKA_VERSION_MINOR 13
|
#define PIKA_VERSION_MINOR 13
|
||||||
#define PIKA_VERSION_MICRO 3
|
#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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user