| 804 | } |
| 805 | |
| 806 | WASMEDGE_CAPI_EXPORT uint32_t WasmEdge_StringCopy(const WasmEdge_String Str, |
| 807 | char *Buf, |
| 808 | const uint32_t Len) noexcept { |
| 809 | uint32_t RealLength = std::min(Len, Str.Length); |
| 810 | if (Buf) { |
| 811 | std::memset(Buf, 0, Len); |
| 812 | if (RealLength > 0) { |
| 813 | std::copy_n(Str.Buf, RealLength, Buf); |
| 814 | } |
| 815 | } |
| 816 | return RealLength; |
| 817 | } |
| 818 | |
| 819 | WASMEDGE_CAPI_EXPORT void WasmEdge_StringDelete(WasmEdge_String Str) noexcept { |
| 820 | if (Str.Buf) { |