mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
84ff4c5b14
Upstream changes from ethereum/go-ethereum Former-commit-id: b40212f60d4e0a11e783a362886c7db8fb9c54f9 [formerly a2112a830d4047afa18c31243c2a506f80d4de12] Former-commit-id: 4c9a4d5662038dd26bda5d3343f231795c702b02
23 lines
293 B
Go
23 lines
293 B
Go
// Copyright (c) 2012 VMware, Inc.
|
|
|
|
package gosigar
|
|
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
func bytePtrToString(ptr *int8) string {
|
|
bytes := (*[10000]byte)(unsafe.Pointer(ptr))
|
|
|
|
n := 0
|
|
for bytes[n] != 0 {
|
|
n++
|
|
}
|
|
|
|
return string(bytes[0:n])
|
|
}
|
|
|
|
func chop(buf []byte) []byte {
|
|
return buf[0 : len(buf)-1]
|
|
}
|