Removed 40 char static buffer used for printing potentially truncated strings.
- The buffer was to small for apps wider than 42 chars.
- The new code is tweaked to be only 8 bytes larger resulting in a win of 32 bytes.
diff --git a/contiki/ctk/ctk-conio.c b/contiki/ctk/ctk-conio.c
index 5636a0d..ae7c18a 100644
--- a/contiki/ctk/ctk-conio.c
+++ b/contiki/ctk/ctk-conio.c
@@ -29,7 +29,7 @@
*
* This file is part of the "ctk" console GUI toolkit for cc65
*
- * $Id: ctk-conio.c,v 1.11 2004/06/27 18:32:10 oliverschmidt Exp $
+ * $Id: ctk-conio.c,v 1.12 2004/06/27 20:59:05 oliverschmidt Exp $
*
*/
@@ -48,13 +48,20 @@
static unsigned char sizex, sizey;
/*-----------------------------------------------------------------------------------*/
-static char tmp[40];
static void
cputsn(char *str, unsigned char len)
{
- strncpy(tmp, str, len);
- tmp[len] = 0;
- cputs(tmp);
+ char c;
+
+ while(len > 0) {
+ --len;
+ c = *str;
+ if(c == 0) {
+ break;
+ }
+ cputc(c);
+ ++str;
+ }
}
/*-----------------------------------------------------------------------------------*/
void