Fix clipboard crash from un-masked scratch on windows

This commit is contained in:
Allen Webster 2020-05-02 10:30:19 -07:00
parent 5b8d22a766
commit b9b44f481a
2 changed files with 10 additions and 10 deletions

View File

@ -1306,7 +1306,7 @@ system_post_clipboard(String_Const_u8 str, i32 index){
// TODO(inso): index?
//LINUX_FN_DEBUG("%.*s", string_expand(str));
linalloc_clear(&linuxvars.clipboard_arena);
linuxvars.clipboard_contents = push_u8_stringf(&linuxvars.clipboard_arena, "%.*s", str.size, str.str);
linuxvars.clipboard_contents = push_u8_stringf(&linuxvars.clipboard_arena, "%.*s", string_expand(str));
XSetSelectionOwner(linuxvars.dpy, linuxvars.atom_CLIPBOARD, linuxvars.win, CurrentTime);
}

View File

@ -355,7 +355,7 @@ system_get_keyboard_modifiers_sig(){
internal String_Const_u8
win32_read_clipboard_contents(Thread_Context *tctx, Arena *arena){
Scratch_Block scratch(tctx);
Scratch_Block scratch(tctx, arena);
String_Const_u8 result = {};