From aa99d8382a7e7b2d5f0d4d7a4ed25adedf61f48d Mon Sep 17 00:00:00 2001 From: qyt <486179@qq.com> Date: Mon, 11 May 2026 08:12:34 +0000 Subject: [PATCH] Potential fix for code scanning alert no. 63 Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../ModuleHelp_Language/ModuleHelp_Language.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp index 6cb5e3e3..93b80157 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp @@ -41,15 +41,22 @@ CModuleHelp_Language::~CModuleHelp_Language() *********************************************************************/ bool CModuleHelp_Language::ModuleHelp_Translation_Convert(ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE enTranslationType, XCHAR* ptszTranslationType) { + /* + * 功能说明: + * 1. 将内部翻译语言枚举值转换为外部翻译服务所需的短码字符串(如 zh/en/jp 等)。 + * 2. 转换结果写入 ptszTranslationType。 + * 3. 发生参数错误或不支持的类型时,统一设置模块错误标记与错误码并返回 false。 + */ ModuleHelp_IsErrorOccur = false; + // 参数合法性检查:输出缓冲区不能为空。 if (NULL == ptszTranslationType) { ModuleHelp_IsErrorOccur = true; ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_LANGUAGE_PARAMENT; return false; } - //转换为服务需要的类型 + // 枚举值到服务端语言短码的映射。 if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_AUTO == enTranslationType) { _tcsxcpy(ptszTranslationType, _X("auto"));