diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 47361e51..dd845783 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -2230,9 +2230,9 @@ func memcmp(a, b unsafe.Pointer, size int) int { return 0 } -func memset(ptr *byte, val int, num int) { +func memset(ptr *byte, val byte, num int) { for i := 0; i < num; i++ { - (*[_Gi]byte)(unsafe.Pointer(ptr))[i] = byte(val) + (*[_Gi]byte)(unsafe.Pointer(ptr))[i] = val } } @@ -2343,7 +2343,7 @@ func malloc(nOfBytes uintptr) unsafe.Pointer { func calloc(val byte, noOfBytes uintptr) unsafe.Pointer { mem := malloc(noOfBytes) - memset((*byte)(mem), int(val), int(noOfBytes)) + memset((*byte)(mem), val, int(noOfBytes)) return mem }