From 7c40549200f5bf754a6145037074975598e63920 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sun, 27 Aug 2023 15:43:40 -0700 Subject: [PATCH] cast two more content_length u64 to usize --- src/aws_credentials.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aws_credentials.zig b/src/aws_credentials.zig index 4a63bfe..f3fc8ab 100644 --- a/src/aws_credentials.zig +++ b/src/aws_credentials.zig @@ -243,7 +243,7 @@ fn getImdsRoleName(allocator: std.mem.Allocator, client: *std.http.Client, imds_ log.warn("Unexpected empty response from IMDS endpoint post token", .{}); return null; } - var resp = try allocator.alloc(u8, req.response.content_length.?); + var resp = try allocator.alloc(u8, @intCast(req.response.content_length.?)); defer allocator.free(resp); _ = try req.readAll(resp); @@ -296,7 +296,7 @@ fn getImdsCredentials(allocator: std.mem.Allocator, client: *std.http.Client, ro log.warn("Unexpected empty response from IMDS role endpoint", .{}); return null; } - var resp = try allocator.alloc(u8, req.response.content_length.?); + var resp = try allocator.alloc(u8, @intCast(req.response.content_length.?)); defer allocator.free(resp); _ = try req.readAll(resp);