mirror of
https://github.com/fumiama/go-hide-param.git
synced 2026-06-05 07:20:25 +08:00
fix -race
This commit is contained in:
4
unix.go
4
unix.go
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
func Hide(position int) {
|
||||
if position > 0 && position < len(os.Args) {
|
||||
pwdstr := (*[2]uintptr)(unsafe.Pointer(&os.Args[position]))
|
||||
p := *(*unsafe.Pointer)(unsafe.Pointer(&os.Args[position]))
|
||||
for i := 0; i < len(os.Args[position]); i++ {
|
||||
*(*uint8)(unsafe.Pointer((*pwdstr)[0] + uintptr(i))) = '*'
|
||||
*(*uint8)(unsafe.Pointer(uintptr(p) + uintptr(i))) = '*'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user