From d1f90ef59cb2c4d4711f10915926b5f373dd8d54 Mon Sep 17 00:00:00 2001 From: Lucas Teske Date: Fri, 25 Sep 2020 18:22:38 -0300 Subject: [PATCH] nintendoswitch: fix crash when printing long lines (> 120) --- src/runtime/runtime_nintendoswitch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/runtime_nintendoswitch.go b/src/runtime/runtime_nintendoswitch.go index 745f7ffc..97148b67 100644 --- a/src/runtime/runtime_nintendoswitch.go +++ b/src/runtime/runtime_nintendoswitch.go @@ -46,7 +46,7 @@ var stdoutBuffer = make([]byte, 120) var position = 0 func putchar(c byte) { - if c == '\n' || position > len(stdoutBuffer) { + if c == '\n' || position >= len(stdoutBuffer) { nxOutputString(&stdoutBuffer[0], uint64(position)) position = 0 return