Description | And thus trying to read a string from the buffer will cut at pre-resize boundary
var f = external_define("a_bug_dll.dll", "buffer_strcpy", dll_cdecl, ty_real, 2, ty_string, ty_string);
var b = buffer_create(12, buffer_grow, 1);
buffer_resize(b, 50);
external_call(f, buffer_get_address(b), "It would seem like there's a bug.");
buffer_seek(b, buffer_seek_start, 0);
show_debug_message(buffer_read(b, buffer_string)); // `It would see`
// now watch this:
buffer_poke(b, buffer_get_size(b) - 1, buffer_u8, 0);
buffer_seek(b, buffer_seek_start, 0);
show_debug_message(buffer_read(b, buffer_string)); // `It would seem like there's a bug.`
|
---|