authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-08-24 02:42:35 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-12-17 18:35:05 -08:00
logbfc5a70fee3b065f523ae5c4754867c497ce87ea
treec03adbcbb35e0e2aae0841065a550a80be15584b
parentcc8fb7cb1654df835a48473d67c001a44d2a6ea9

asciiUpper: use dupeZ


1 files changed, 2 insertions(+), 2 deletions(-)

src/asciiUpper.zig+2-2
...@@ -2,8 +2,8 @@ const std = @import("std");...@@ -2,8 +2,8 @@ const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const extras = @import("./lib.zig");3const extras = @import("./lib.zig");
44
5pub fn asciiUpper(alloc: std.mem.Allocator, input: string) ![]u8 {5pub fn asciiUpper(alloc: std.mem.Allocator, input: string) ![:0]u8 {
6 var buf = try alloc.dupe(u8, input);6 var buf = try alloc.dupeZ(u8, input);
7 for (0..buf.len) |i| {7 for (0..buf.len) |i| {
8 buf[i] = std.ascii.toUpper(buf[i]);8 buf[i] = std.ascii.toUpper(buf[i]);
9 }9 }