authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-06-15 18:34:56+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-06-17 21:04:21+03:00
loga224dfceee07a94d961506122a434563129428a5
tree32f5829396e02e4b3d7411022cd5bc95cc134f84
parentb9dcbe6b4c0bee37b31bf46424f284af331d4696

std.tz: fix function returning pointer to local variable


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

lib/std/tz.zig+1-4
......@@ -11,7 +11,7 @@ pub const Timetype = struct {
1111 flags: u8,
1212 name_data: [6:0]u8,
1313
14 pub fn name(self: Timetype) [:0]const u8 {
14 pub fn name(self: *const Timetype) [:0]const u8 {
1515 return std.mem.sliceTo(self.name_data[0..], 0);
1616 }
1717
......@@ -214,7 +214,6 @@ pub const Tz = struct {
214214};
215215
216216test "slim" {
217 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
218217 const data = @embedFile("tz/asia_tokyo.tzif");
219218 var in_stream = std.io.fixedBufferStream(data);
220219
......@@ -228,7 +227,6 @@ test "slim" {
228227}
229228
230229test "fat" {
231 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
232230 const data = @embedFile("tz/antarctica_davis.tzif");
233231 var in_stream = std.io.fixedBufferStream(data);
234232
......@@ -241,7 +239,6 @@ test "fat" {
241239}
242240
243241test "legacy" {
244 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
245242 // Taken from Slackware 8.0, from 2001
246243 const data = @embedFile("tz/europe_vatican.tzif");
247244 var in_stream = std.io.fixedBufferStream(data);