Skip to content

Commit

Permalink
Zero unused bytes in chain name on add
Browse files Browse the repository at this point in the history
  • Loading branch information
schmee committed Oct 28, 2023
1 parent 7419513 commit acd3698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ pub fn main() !void {

var chain = Chain{
.id = chain_db.meta.id_counter,
.name = undefined,
.name = std.mem.zeroes([128]u8),
.name_len = @as(u16, @intCast(name.len)),
.kind = kind,
.color = color.colors[chain_db.meta.len % color.colors.len],
Expand Down

0 comments on commit acd3698

Please sign in to comment.