From a24d0c9faf83ebe486fc4dfd660a9ee4bc78c52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristo=CC=81fer=20R?= Date: Tue, 13 May 2025 23:15:23 -0400 Subject: [PATCH] re-order end-of-hostname validity check --- src/os/hostname.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/hostname.zig b/src/os/hostname.zig index 747c145d4..998b80fac 100644 --- a/src/os/hostname.zig +++ b/src/os/hostname.zig @@ -55,8 +55,8 @@ pub fn parseUrl(url: []const u8) !std.Uri { // The first '/' after the scheme marks the end of the hostname. If the first '/' // following the end of the scheme is not at the right position this is not a // valid mac address. - if (std.mem.indexOfScalarPos(u8, url_without_scheme, 0, '/') != 17 and - url_without_scheme.len != 17) + if (url_without_scheme.len != 17 and + std.mem.indexOfScalarPos(u8, url_without_scheme, 0, '/') != 17) { return error.HostnameIsNotMacAddress; }