From bf8143c649292042de87c0cef63e6cb3c523388f Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: 周四, 08 5月 2025 16:40:10 +0800 Subject: [PATCH] 修改了一些警告信息 --- libscpi/src/units.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/libscpi/src/units.c b/libscpi/src/units.c index e68af41..25ce33f 100644 --- a/libscpi/src/units.c +++ b/libscpi/src/units.c @@ -42,6 +42,7 @@ #include "scpi/utils.h" #include "scpi/error.h" #include "lexer_private.h" +#include "scpi/types.h" /* @@ -63,6 +64,13 @@ /* * units definition IEEE 488.2-1992 tab 7-1 */ + + +/* + scpi_units_def 鏄崟浣嶅畾涔夎〃 鎻愪緵鍗曚綅杞崲 + 鎷撳睍鍗曚綅鍦ㄦ澶勬坊鍔� +*/ + const scpi_unit_def_t scpi_units_def[] = { #if USE_UNITS_PARTICLES /* Absorbet dose */ @@ -273,6 +281,9 @@ /* * Special number values definition */ + + +//鐗规畩鏁板�煎畾涔� const scpi_choice_def_t scpi_special_numbers_def[] = { {/* name */ "MINimum", /* type */ SCPI_NUM_MIN}, {/* name */ "MAXimum", /* type */ SCPI_NUM_MAX}, @@ -484,7 +495,7 @@ if (value->special) { if (SCPI_ChoiceToName(special, value->content.tag, &type)) { - strncpy(str, type, len); + memcpy(str, type, len); result = SCPIDEFINE_strnlen(str, len - 1); str[result] = '\0'; return result; -- Gitblit v1.9.1