diff --git a/factory.c b/factory.c index d4666157..ee6f9514 100644 --- a/factory.c +++ b/factory.c @@ -809,8 +809,9 @@ void Button_Brush_Factory(void) } else if (lua_pcall(L, 0, 0, 0) != 0) { - message = lua_tostring(L, 1); - if(message) + int stack_size; + stack_size= lua_gettop(L); + if (stack_size>0 && (message = lua_tostring(L, stack_size))!=NULL) Verbose_error_message(message); else Warning_message("Unknown error running script!"); diff --git a/pages.c b/pages.c index 7ba40e6d..9abe14a9 100644 --- a/pages.c +++ b/pages.c @@ -283,7 +283,7 @@ void Redraw_spare_image(void) // Copy it in Spare_visible_image memcpy(Spare_visible_image.Image, Spare_backups->Pages->Image[layer], - Spare_image_width*Main_image_height); + Spare_image_width*Spare_image_height); // No depth buffer in the spare //memset(Spare_visible_image_depth_buffer.Image,