From 6e40d1751ec11a717529545c7253fc6a8236bc24 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 2 Mar 2016 23:42:43 +0100 Subject: [PATCH] Silence warning Conversion to use of strncpy had led to the length of a (char*) being tested, and atypically we got away with that so far because the copied string was only 2 characters long. Now we use length limit 4, which also renders the use of strncpy instead of strcpy useless, but at least does notproduce a warning. --- engineoutput.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/engineoutput.c b/engineoutput.c index ac1103e..2d0bd06 100644 --- a/engineoutput.c +++ b/engineoutput.c @@ -703,7 +703,7 @@ OutputKibitz (int window, char *text) } opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes. VerifyDisplayMode(); - strncpy(text+strlen(text)-1, "\r\n",sizeof(text+strlen(text)-1)); // to not lose line breaks on copying + strncpy(text+strlen(text)-1, "\r\n", 4); // to not lose line breaks on copying if(gameMode == IcsObserving) { DoSetWindowText(0, nLabel, gameInfo.white); SetIcon( 0, nColorIcon, nColorWhite); -- 1.7.0.4