--- simulavr-0.1.2.6/src/disp-vcd/config_scanner.c.orig	2009-02-24 21:14:50.000000000 +0100
+++ simulavr-0.1.2.6/src/disp-vcd/config_scanner.c	2010-01-31 13:32:22.000000000 +0100
@@ -553,7 +553,7 @@
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { int __echo_len__; __echo_len__ = fwrite( yytext, yyleng, 1, yyout ); } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
--- simulavr-0.1.2.6/src/disp-vcd/config_scanner.c.orig	2010-01-31 12:28:52.000000000 +0100
+++ simulavr-0.1.2.6/src/disp-vcd/config_scanner.c	2010-01-31 13:32:22.000000000 +0100
@@ -1185,7 +1185,7 @@
 #ifdef __cplusplus
 static int yyinput()
 #else
-static int input()
+int input()
 #endif
 	{
 	int c;
--- simulavr-0.1.2.6/src/eeprom.c.orig	2010-01-31 12:35:17.000000000 +0100
+++ simulavr-0.1.2.6/src/eeprom.c	2010-01-31 13:32:22.000000000 +0100
@@ -416,7 +416,7 @@
             line[0] = '\0';
         }
         snprintf (buf, 80, "%02x ", storage_readb (eeprom->stor, i));
-        strncat (line, buf, 80);
+        strncat (line, buf, sizeof(line)-strlen(line)-1);
     }
     if (dup > 0)
     {
--- simulavr-0.1.2.6/src/flash.c.orig	2010-01-31 12:40:18.000000000 +0100
+++ simulavr-0.1.2.6/src/flash.c	2010-01-31 13:32:22.000000000 +0100
@@ -252,7 +252,7 @@
             line[0] = '\0';
         }
         snprintf (buf, 80, "%04x ", flash_read (flash, i));
-        strncat (line, buf, 80);
+        strncat (line, buf, sizeof(line)-strlen(line)-1);
     }
     if (dup > 0)
     {
--- simulavr-0.1.2.6/src/memory.c.orig	2010-01-31 12:42:19.000000000 +0100
+++ simulavr-0.1.2.6/src/memory.c	2010-01-31 13:32:22.000000000 +0100
@@ -424,7 +424,7 @@
             line[0] = '\0';
         }
         snprintf (buf, 80, "%02x ", mem_read (mem, i));
-        strncat (line, buf, 80);
+        strncat (line, buf, sizeof(line)-strlen(line)-1);
     }
     if (dup > 0)
     {
