diff --git a/core/os/os2/path_linux.odin b/core/os/os2/path_linux.odin index e4c92a871..3120fcda3 100644 --- a/core/os/os2/path_linux.odin +++ b/core/os/os2/path_linux.odin @@ -211,7 +211,7 @@ _getwd :: proc(allocator: runtime.Allocator) -> (string, Error) { #no_bounds_check res := unix.sys_getcwd(&buf[0], uint(len(buf))) if res >= 0 { - return strings.string_from_zero_terminated_ptr(&buf[0], len(buf)), nil + return strings.string_from_null_terminated_ptr(&buf[0], len(buf)), nil } if res != -ERANGE { return "", _get_platform_error(res) diff --git a/core/os/os_linux.odin b/core/os/os_linux.odin index 0e2af6609..3dc48087a 100644 --- a/core/os/os_linux.odin +++ b/core/os/os_linux.odin @@ -913,7 +913,7 @@ get_current_directory :: proc() -> string { #no_bounds_check res := unix.sys_getcwd(&buf[0], uint(len(buf))) if res >= 0 { - return strings.string_from_zero_terminated_ptr(&buf[0], len(buf)) + return strings.string_from_null_terminated_ptr(&buf[0], len(buf)) } if _get_errno(res) != ERANGE { delete(buf) diff --git a/core/strings/strings.odin b/core/strings/strings.odin index b9cecae9d..8193f4de1 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -86,7 +86,7 @@ NOTE: The created string is only valid as long as the pointer and length are val **Returns** A string created from the null-terminated byte pointer and length */ -string_from_zero_terminated_ptr :: proc(ptr: ^byte, len: int) -> string { +string_from_null_terminated_ptr :: proc(ptr: ^byte, len: int) -> string { s := transmute(string)mem.Raw_String{ptr, len} s = truncate_to_byte(s, 0) return s