Skip to content

Commit f7791b5

Browse files
authored
Fix double newline when \n char at end of line (#561)
1 parent 4dcc4cc commit f7791b5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

libctru/source/console.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -892,12 +892,6 @@ void consolePrintChar(int c) {
892892
if(currentConsole->PrintChar(currentConsole, c))
893893
return;
894894

895-
if(currentConsole->cursorX >= currentConsole->windowWidth) {
896-
currentConsole->cursorX = 0;
897-
898-
newRow();
899-
}
900-
901895
switch(c) {
902896
/*
903897
The only special characters we will handle are tab (\t), carriage return (\r), line feed (\n)
@@ -933,6 +927,11 @@ void consolePrintChar(int c) {
933927
gfxFlushBuffers();
934928
break;
935929
default:
930+
if(currentConsole->cursorX >= currentConsole->windowWidth) {
931+
currentConsole->cursorX = 0;
932+
933+
newRow();
934+
}
936935
consoleDrawChar(c);
937936
++currentConsole->cursorX ;
938937
break;

0 commit comments

Comments
 (0)