Fixed some warnings from g++ 7.2.0 regarding fixed buffer sizes

This commit is contained in:
Klaus Schmidinger
2018-03-23 15:47:26 +01:00
parent b539134e54
commit 1f16ada70c
4 changed files with 12 additions and 13 deletions

View File

@@ -6,7 +6,7 @@
*
* Original version written by Udo Richter <udo_richter@gmx.de>.
*
* $Id: shutdown.c 4.1 2015/07/18 11:29:26 kls Exp $
* $Id: shutdown.c 4.2 2018/03/23 15:39:21 kls Exp $
*/
#include "shutdown.h"
@@ -69,10 +69,7 @@ bool cCountdown::Update(void)
timedOut = true;
if (counter != NewCounter) {
counter = NewCounter;
char time[10];
snprintf(time, sizeof(time), "%d:%d0", counter > 0 ? counter / 6 : 0, counter > 0 ? counter % 6 : 0);
cString Message = cString::sprintf(message, time);
Skins.Message(mtStatus, Message);
Skins.Message(mtStatus, cString::sprintf(message, *cString::sprintf("%d:%d0", counter > 0 ? counter / 6 : 0, counter > 0 ? counter % 6 : 0)));
return true;
}
}