[nostalgia] Replace C strings with ox::StringView
This commit is contained in:
@@ -17,9 +17,11 @@ ox::String getClipboardText(Context *ctx) noexcept {
|
||||
return glfwGetClipboardString(id->window);
|
||||
}
|
||||
|
||||
void setClipboardText(Context *ctx, const ox::String &text) noexcept {
|
||||
void setClipboardText(Context *ctx, ox::CRStringView text) noexcept {
|
||||
const auto id = ctx->windowerData<GlfwImplData>();
|
||||
glfwSetClipboardString(id->window, text.c_str());
|
||||
auto cstr = ox_malloca(text.bytes() + 1, char);
|
||||
ox_strncpy(cstr.get(), text.data(), text.bytes());
|
||||
glfwSetClipboardString(id->window, cstr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user