From b46b744d7195973d7baf964f34afa7de9d210d15 Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Fri, 22 May 2020 22:40:03 +0200 Subject: [PATCH] Make renderblended expect a 0-terminated string --- src/ttf.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ttf.zig b/src/ttf.zig index 86cf83b..4787c79 100644 --- a/src/ttf.zig +++ b/src/ttf.zig @@ -36,7 +36,7 @@ pub const Font = struct { c.TTF_CloseFont(self.font); } - pub fn renderBlended(self: Font, text: []const u8, color: sdl.Color) !sdl.Surface { + pub fn renderBlended(self: Font, text: [:0]const u8, color: sdl.Color) !sdl.Surface { var cText = @ptrCast([*c]const u8, text); if (c.TTF_RenderUTF8_Blended(self.font, cText, @bitCast(c.SDL_Color, color))) |surface| { return sdl.Surface{ .surface = @ptrCast(*sdl.c.SDL_Surface, surface) };