From 05c8eba11c51ca928eee9c041de1a4192e590aec Mon Sep 17 00:00:00 2001
From: nianjiuhuiyi <64776403+nianjiuhuiyi@users.noreply.github.com>
Date: 星期五, 27 六月 2025 09:57:45 +0800
Subject: [PATCH] Fix: 修复c++后端服务因为空数组的异常退出,以及c++的http服务在收到Ctrl+C信号后无法正常退出 (#2571)

---
 runtime/onnxruntime/src/encode_converter.cpp |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/runtime/onnxruntime/src/encode_converter.cpp b/runtime/onnxruntime/src/encode_converter.cpp
index 6c1097e..2ba6109 100644
--- a/runtime/onnxruntime/src/encode_converter.cpp
+++ b/runtime/onnxruntime/src/encode_converter.cpp
@@ -441,7 +441,7 @@
 }
 
 bool EncodeConverter::IsAllChineseCharactor(const U8CHAR_T* pu8, size_t ilen) {
-    if (pu8 == NULL || ilen <= 0) {
+    if (pu8 == nullptr || ilen <= 0) {
         return false;
     }
 
@@ -458,7 +458,7 @@
 }
 
 bool EncodeConverter::HasAlpha(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -471,7 +471,7 @@
 
 
 bool EncodeConverter::IsAllAlpha(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -483,7 +483,7 @@
 }
 
 bool EncodeConverter::IsAllAlphaAndPunct(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   bool flag1 = HasAlpha(pu8, ilen);
@@ -500,7 +500,7 @@
 }
 
 bool EncodeConverter::IsAllAlphaAndDigit(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   bool flag1 = HasAlpha(pu8, ilen);
@@ -516,7 +516,7 @@
   return true;
 }
 bool EncodeConverter::IsAllAlphaAndDigitAndBlank(const U8CHAR_T* pu8, size_t ilen) {
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   for (size_t i = 0; i < ilen; i++) {
@@ -529,7 +529,7 @@
 bool EncodeConverter::NeedAddTailBlank(std::string str) {
   U8CHAR_T *pu8 = (U8CHAR_T*)str.data();
   size_t ilen = str.size();
-  if (pu8 == NULL || ilen <= 0) {
+  if (pu8 == nullptr || ilen <= 0) {
     return false;
   }
   if (IsAllAlpha(pu8, ilen) || IsAllAlphaAndPunct(pu8, ilen) || IsAllAlphaAndDigit(pu8, ilen)) {

--
Gitblit v1.9.1