From 5d274abc8c09f9f05fde2991d110cd2b6c46932b Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Sat, 20 Aug 2022 00:44:25 +0200 Subject: [PATCH] avoid returning pointer to local --- examples/graphics_context.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/graphics_context.zig b/examples/graphics_context.zig index c4a3973..df6367d 100644 --- a/examples/graphics_context.zig +++ b/examples/graphics_context.zig @@ -144,7 +144,7 @@ pub const GraphicsContext = struct { self.vki.destroyInstance(self.instance, null); } - pub fn deviceName(self: GraphicsContext) []const u8 { + pub fn deviceName(self: *const GraphicsContext) []const u8 { const len = std.mem.indexOfScalar(u8, &self.props.device_name, 0).?; return self.props.device_name[0..len]; }