diff --git a/examples/winapi/winapi.q b/examples/winapi/winapi.q index 6e81b03..e4a670f 100644 --- a/examples/winapi/winapi.q +++ b/examples/winapi/winapi.q @@ -1,4 +1,5 @@ main() { - text := "Hi!\0" - user32.MessageBoxA(0, text, text, 0x240040) + title := "Title." + text := "Hi!" + user32.MessageBoxA(0, text, title, 0x240040) } \ No newline at end of file diff --git a/src/core/TokenToRegister.go b/src/core/TokenToRegister.go index d2daab6..c467895 100644 --- a/src/core/TokenToRegister.go +++ b/src/core/TokenToRegister.go @@ -48,7 +48,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) (types. data := t.Bytes(f.File.Bytes) data = String(data) - slice := make([]byte, len(data)+8) + slice := make([]byte, len(data)+8+1) binary.LittleEndian.PutUint64(slice, uint64(len(data))) copy(slice[8:], data)