From 77a93bb43d373a59df9da29053b9e64b4b3cf474 Mon Sep 17 00:00:00 2001
From: Joel Bodenmann <joel@unormal.org>
Date: Thu, 10 Jan 2013 15:03:34 +0100
Subject: TDISP update

---
 src/tdisp/tdisp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/tdisp/tdisp.c b/src/tdisp/tdisp.c
index a6e5e2f5..edd5b423 100644
--- a/src/tdisp/tdisp.c
+++ b/src/tdisp/tdisp.c
@@ -50,6 +50,9 @@ void tdispHome(void) {
 void tdispGotoXY(coord_t col, coord_t row) {
 	uint8_t row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
 
+	if(row >= TDISP_ROWS)
+		row = TDISP_ROWS - 1;
+
 	TDISP_LLD(write_cmd)(0x80 | (col + row_offsets[row]));
 }
 
@@ -60,7 +63,7 @@ void tdispDrawChar(char c) {
 void tdispDrawString(char *s) {
 	char c;
 
-	while(c = s++)
+	while(c = *s++)
 		tdispDrawChar(c);	
 }
 
-- 
cgit v1.2.3