removed check and #includes for malloc.h, since it's not needed
[xboard.git] / history.c
index 4598799..6773133 100644 (file)
--- a/history.c
+++ b/history.c
@@ -28,7 +28,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include <string.h>
 
 #include "common.h"
@@ -132,7 +131,7 @@ static void AppendMoveToMemo( int index )
     }
 
     /* Move text */
-    strcpy( buf, SavePart( currMovelist[index] ) );
+    safeStrCpy( buf, SavePart( currMovelist[index]) , sizeof( buf)/sizeof( buf[0]) );
     strcat( buf, " " );
 
     histMoves[index].memoOffset = AppendToHistoryMemo( buf, 0, 0 );
@@ -184,7 +183,7 @@ void MemoContentUpdated()
     lastLastMove[0] = '\0';
 
     if( lastLast > 0 ) {
-        strcpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) );
+      safeStrCpy( lastLastMove, SavePart( currMovelist[lastLast-1] ) , sizeof( lastLastMove)/sizeof( lastLastMove[0]) );
     }
 
     /* Deselect any text, move caret to end of memo */