mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-21 00:35:22 -04:00
@@ -47,7 +47,7 @@ void ArkNativeString::GetCString(char* buffer, size_t size, size_t* length)
|
||||
if (buffer == nullptr) {
|
||||
*length = val->Utf8Length() - 1;
|
||||
} else if (size != 0) {
|
||||
int copied = val->WriteUtf8(buffer, size) - 1;
|
||||
int copied = val->WriteUtf8(buffer, size - 1) - 1;
|
||||
buffer[copied] = '\0';
|
||||
*length = copied;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user