mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 11:52:22 -07:00
Fix memset for unix
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//+build !windows
|
||||
//+build linux, darwin
|
||||
package runtime
|
||||
|
||||
@(link_name="memset")
|
||||
@@ -6,7 +6,7 @@ memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr {
|
||||
b := byte(val);
|
||||
|
||||
p_start := uintptr(ptr);
|
||||
p_end := p + uintptr(max(len, 0));
|
||||
p_end := p_start + uintptr(max(len, 0));
|
||||
for p := p_start; p < p_end; p += 1 {
|
||||
(^byte)(p)^ = b;
|
||||
}
|
||||
Reference in New Issue
Block a user