Fixed extra junk after ms string with bufPrintZ

This commit is contained in:
2025-01-06 09:33:38 -07:00
parent 41a208846a
commit 5680b1a5a5
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ pub fn main() !void {
var buf: [8]u8 = undefined;
const timer_ms = timer.getTicks();
// const timer_base = std.math.log10(timer_ms) + 3;
const time_str: []const u8 = try std.fmt.bufPrint(&buf, "{d}ms", .{timer_ms});
const time_str: [*:0]const u8 = try std.fmt.bufPrintZ(&buf, "{d}ms", .{timer_ms});
var time_text = try GameText.loadFromRenderedText(time_str, RGBAColor.whiteSmoke().tosdl());
try time_text.render(
&game_state,