authorgravatar for 2179872-misanthrop@users.noreply.gitlab.comSashko <2179872-misanthrop@users.noreply.gitlab.com> 2024-03-30 17:36:21+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-01 19:44:20-04:00
log8ef24461a0016062e0ca20d1a152dd82fac511ab
tree5c0a0ed6186395d6d3f56d615359d99f8294679d
parentcb308ba3ac2d7e3735d1cb42ef085edb1e6db723

DynLib: fix a typo in DynLib.openZ


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

lib/std/dynamic_library.zig+3-2
......@@ -31,7 +31,7 @@ pub const DynLib = struct {
3131
3232 /// Trusts the file. Malicious file will be able to execute arbitrary code.
3333 pub fn openZ(path_c: [*:0]const u8) Error!DynLib {
34 return .{ .inner = try InnerType.open(path_c) };
34 return .{ .inner = try InnerType.openZ(path_c) };
3535 }
3636
3737 /// Trusts the file.
......@@ -376,7 +376,7 @@ pub const WindowsDynLib = struct {
376376 /// WindowsDynLib specific
377377 /// Opens dynamic library with specified library loading flags.
378378 pub fn openExZ(path_c: [*:0]const u8, flags: windows.LoadLibraryFlags) Error!WindowsDynLib {
379 const path_w = try windows.cStrToPrefixedFileW(null, path_c);
379 const path_w = windows.cStrToPrefixedFileW(null, path_c) catch return error.InvalidPath;
380380 return openExW(path_w.span().ptr, flags);
381381 }
382382
......@@ -466,4 +466,5 @@ test "dynamic_library" {
466466 };
467467
468468 try testing.expectError(error.FileNotFound, DynLib.open(libname));
469 try testing.expectError(error.FileNotFound, DynLib.openZ(libname.ptr));
469470}