Browse Source

Fix linux.dirent_name

Was not searching the first possible byte for 0.
jason 5 tháng trước cách đây
mục cha
commit
4998d4ebd0
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      core/sys/linux/wrappers.odin

+ 1 - 1
core/sys/linux/wrappers.odin

@@ -93,10 +93,10 @@ dirent_name :: proc "contextless" (dirent: ^Dirent) -> string #no_bounds_check {
 	trunc := min(str_size, 8)
 	str_size -= trunc
 	for _ in 0..<trunc {
-		str_size += 1
 		if str[str_size] == 0 {
 			break
 		}
+		str_size += 1
 	}
 	return string(str[:str_size])
 }