X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=history.c;h=62268898006d2c8e4f4e78a98970d9ec24bf8a51;hb=b8bd259a053aef05b8f0ee07886702b5870234cf;hp=4598799f2952ebf84173e1a7c7e02fe3f46040ec;hpb=f1fbc14f88e6dfef22020dc193f3b4805952778c;p=xboard.git diff --git a/history.c b/history.c index 4598799..6226889 100644 --- a/history.c +++ b/history.c @@ -28,7 +28,6 @@ #include #include -#include #include #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 ); @@ -175,8 +174,7 @@ void MemoContentUpdated() { int caretPos; - DoHighlight( lastCurrent, FALSE ); - DoHighlight( currCurrent, TRUE ); + if(lastCurrent <= currLast) DoHighlight( lastCurrent, FALSE ); lastFirst = currFirst; lastLast = currLast; @@ -184,7 +182,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 */ @@ -196,6 +194,7 @@ void MemoContentUpdated() } ScrollToCurrent(caretPos); + DoHighlight( currCurrent, TRUE ); // [HGM] moved last, because in X some scrolling methods spoil highlighting } // back-end. Must be called as double-click call-back on move-history text edit