Added a zero byte at the end of strings
This commit is contained in:
parent
b1228be79a
commit
064bb3acc7
@ -1,4 +1,5 @@
|
|||||||
main() {
|
main() {
|
||||||
text := "Hi!\0"
|
title := "Title."
|
||||||
user32.MessageBoxA(0, text, text, 0x240040)
|
text := "Hi!"
|
||||||
|
user32.MessageBoxA(0, text, title, 0x240040)
|
||||||
}
|
}
|
@ -48,7 +48,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) (types.
|
|||||||
data := t.Bytes(f.File.Bytes)
|
data := t.Bytes(f.File.Bytes)
|
||||||
data = String(data)
|
data = String(data)
|
||||||
|
|
||||||
slice := make([]byte, len(data)+8)
|
slice := make([]byte, len(data)+8+1)
|
||||||
binary.LittleEndian.PutUint64(slice, uint64(len(data)))
|
binary.LittleEndian.PutUint64(slice, uint64(len(data)))
|
||||||
copy(slice[8:], data)
|
copy(slice[8:], data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user