From eca4cbc419d0bc3c3ecdf4d2affa42f9bfe9fb56 Mon Sep 17 00:00:00 2001 From: cloudhan Date: Thu, 5 May 2022 23:07:50 +0800 Subject: [PATCH] Avoid using word 'crazy' (#11396) Avoid using word 'crazy' and simplify the comment of else branch --- onnxruntime/core/platform/android/cxa_demangle.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/onnxruntime/core/platform/android/cxa_demangle.cc b/onnxruntime/core/platform/android/cxa_demangle.cc index 9fe4bb674e..ebeca2b03c 100644 --- a/onnxruntime/core/platform/android/cxa_demangle.cc +++ b/onnxruntime/core/platform/android/cxa_demangle.cc @@ -52,10 +52,9 @@ char* __cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status if (!initialize_output_buffer(buf, n, buf_size, 1024)) { internal_status = DEMANGLE_MEMORY_ALLOCATION_FAILURE; } else { + // This might cause a truncated mangled name being returned without error, + // but should be fine for debugging purpose. strncpy(buf, mangled_name, buf_size); - // Blindly guard the output buffer, this might cause a truncated mangled name being returned without error status, - // but this should be fine for debugging purpose. As we are returning the mangle name directly, if the caller is - // doing crazy stuff with the name, it should both fail with the return mangled name and a truncated mangled name. buf[buf_size - 1] = '\0'; }