news_gui.c
changeset 1329 a8a0d60b0a8e
parent 1309 dab90d4cbf2d
child 1336 c9e6b766bf21
--- a/news_gui.c	Sun Feb 06 20:53:31 2005 +0000
+++ b/news_gui.c	Sun Feb 06 22:25:27 2005 +0000
@@ -503,10 +503,11 @@
 }
 
 // cut string after len pixels
-static void GetNewsString(NewsItem *ni, byte *buffer, uint max)
+static void GetNewsString(NewsItem *ni, char *buffer, uint max)
 {
 	StringID str;
-	byte *s, *d;
+	const char *s;
+	char *d;
 	uint len = 0;
 
 	if (ni->display_mode == 3) {
@@ -537,8 +538,8 @@
 		} else if (*s == '\r') {
 			d[0] = d[1] = d[2] = d[3] = ' ';
 			d += 4;
-		} else if (*s >= ' ' && (*s < 0x88 || *s >= 0x99)) {
-			len += _stringwidth_table[*s - 32];
+		} else if ((byte)*s >= ' ' && ((byte)*s < 0x88 || (byte)*s >= 0x99)) {
+			len += _stringwidth_table[(byte)*s - 32];
 			*d++ = *s;
 		}
 	}
@@ -549,7 +550,6 @@
 {
 	switch (e->event) {
 	case WE_PAINT: {
-		byte buffer[256];
 		int y = 19;
 		byte p, show;
 		NewsItem *ni;
@@ -560,6 +560,8 @@
 		show = min(_total_news, w->vscroll.cap);
 
 		for (p = w->vscroll.pos; p < w->vscroll.pos + show; p++) {
+			char buffer[256];
+
 			// get news in correct order
 			ni = &_news_items[getNews(p)];