Merge pull request #180 from rpkak/remove-additional-null-termination

Remove additional null termination
This commit is contained in:
Robin Voetter
2025-04-02 10:08:26 +02:00
committed by GitHub

View File

@@ -1496,8 +1496,7 @@ fn Renderer(comptime WriterType: type) type {
\\pub fn load({[params]s}) Self {{
\\ var self: Self = .{{ .dispatch = .{{}} }};
\\ inline for (std.meta.fields(Dispatch)) |field| {{
\\ const name: [*:0]const u8 = @ptrCast(field.name ++ "\x00");
\\ const cmd_ptr = loader({[first_arg]s}, name) orelse undefined;
\\ const cmd_ptr = loader({[first_arg]s}, field.name.ptr) orelse undefined;
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
\\ }}
\\ return self;