diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index e4b8578a..214715ca 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -896,7 +896,6 @@ wrap_state_consume_token(System_Functions *system, Render_Font *font, Code_Wrap_ do{ for (; i < state->stream.end; ++i){ if (!(i < end)){ - Assert(state->tran.fill_expected == 0); goto doublebreak; } diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index 99d53918..56db2276 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -173,14 +173,16 @@ global Coroutine_System_Auto_Alloc coroutines; //////////////////////////////// internal void -win32_output_error_string(){ +win32_output_error_string(b32 use_error_box = true){ DWORD error = GetLastError(); char *str = 0; char *str_ptr = (char*)&str; if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0, error, 0, str_ptr, 0, 0)){ LOGF("win32 error:\n%s\n", str); - system_error_box(str, false); + if (use_error_box){ + system_error_box(str, false); + } } } @@ -284,15 +286,17 @@ Sys_Send_Exit_Signal_Sig(system_send_exit_signal){ internal Sys_Post_Clipboard_Sig(system_post_clipboard){ if (OpenClipboard(win32vars.window_handle)){ - EmptyClipboard(); - HANDLE memory_handle; - memory_handle = GlobalAlloc(GMEM_MOVEABLE, str.size+1); + if (!EmptyClipboard()){ + win32_output_error_string(false); + } + HANDLE memory_handle = GlobalAlloc(GMEM_MOVEABLE, str.size + 1); if (memory_handle){ char *dest = (char*)GlobalLock(memory_handle); copy_fast_unsafe_cs(dest, str); + dest[str.size] = 0; GlobalUnlock(memory_handle); SetClipboardData(CF_TEXT, memory_handle); - win32vars.next_clipboard_is_self = 1; + win32vars.next_clipboard_is_self = true; } CloseClipboard(); } diff --git a/string/4coder_string_build_num.txt b/string/4coder_string_build_num.txt index d5e6514d..252ae6bd 100644 --- a/string/4coder_string_build_num.txt +++ b/string/4coder_string_build_num.txt @@ -1,5 +1,5 @@ 1 0 -108 +109