diff mbox

core/console: use char literals instead of numeric

Message ID 1469407443-31800-1-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran July 25, 2016, 12:44 a.m. UTC
Save everyone a trip to asciitable.com. I realise everyone has probably
memorised \n and friends, but THAT'S NOT THE POINT.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrew Donnellan July 25, 2016, 12:54 a.m. UTC | #1
On 25/07/16 10:44, Oliver O'Halloran wrote:
> Save everyone a trip to asciitable.com. I realise everyone has probably
> memorised \n and friends, but THAT'S NOT THE POINT.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Stewart Smith July 25, 2016, 2:18 a.m. UTC | #2
Oliver O'Halloran <oohall@gmail.com> writes:
> Save everyone a trip to asciitable.com. I realise everyone has probably
> memorised \n and friends, but THAT'S NOT THE POINT.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

thanks, merged to master as of 46c006f730df0b20500fde8dd495b94711eaa8ee
diff mbox

Patch

diff --git a/core/console.c b/core/console.c
index e851fcf824a9..730ac245fd94 100644
--- a/core/console.c
+++ b/core/console.c
@@ -258,8 +258,8 @@  ssize_t console_write(bool flush_to_drivers, const void *buf, size_t count)
 
 	while(count--) {
 		char c = *(cbuf++);
-		if (c == 10)
-			write_char(13);
+		if (c == '\n')
+			write_char('\r');
 		write_char(c);
 	}