From 4c11ea0639b923a171e72a47b8006734ba184b3e Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: 周二, 15 4月 2025 18:47:46 +0800 Subject: [PATCH] 同步修改前的原SCPI库 --- libscpi/src/utils.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/libscpi/src/utils.c b/libscpi/src/utils.c index 328f8be..e0aa9a0 100644 --- a/libscpi/src/utils.c +++ b/libscpi/src/utils.c @@ -675,6 +675,8 @@ * * prev and current should be in the same memory buffer */ + + //缁勫悎澶嶅悎SCPI鍛戒护 scpi_bool_t composeCompoundCommand(const scpi_token_t * prev, scpi_token_t * current) { size_t i; @@ -687,6 +689,7 @@ return TRUE; /* Common command or command root - nothing to do */ + // 褰撳墠鍛戒护鏄叕鍏卞懡浠�(*)鎴栨牴鍛戒护(:) if (current->ptr[0] == '*' || current->ptr[0] == ':') return TRUE; @@ -707,6 +710,7 @@ current->ptr -= i; current->len += i; + //澶嶅悎鍛戒护缁勫悎 memmove(current->ptr, prev->ptr, i); return TRUE; } @@ -754,7 +758,8 @@ #if USE_MEMORY_ALLOCATION_FREE && !HAVE_STRNDUP char *OUR_strndup(const char *s, size_t n) { size_t len = SCPIDEFINE_strnlen(s, n); - char * result = malloc(len + 1); + //msvc涓嬮渶瑕佸己杞� + char * result =(char*) malloc(len + 1); if (!result) { return NULL; } -- Gitblit v1.9.1