commit - 9a6f35d1144f9f50bcc138716e91666af257d439
commit + 679bf294d1a0924d7783ab6748f1ff327200373b
blob - f8da9fd38b5d2b42c49b02cf551e89a99f8750a8
blob + 7b1d44e3b43f8ee52c529942ead229b5ffd2d351
--- FICS/gamedb.c
+++ FICS/gamedb.c
#include "rmalloc.h"
#include "utils.h"
+#if __linux__
+#include <bsd/string.h>
+#endif
+
/*
* This should be enough to hold any game up to at least 250 moves. If
* we overwrite this, the server will crash.
static char tstr[50] = { '\0' };
if ((!wt) && (!winc)) { // Untimed
- strcpy(tstr, "");
+ (void) strlcpy(tstr, "", sizeof tstr);
return tstr;
}
PieceChar = PieceToChar(piecetype(piece) | WHITE);
if (PieceChar == 'K' && m->fromFile == 4 && m->toFile == 6) {
- strcpy(m->algString, "O-O");
- strcpy(m->moveString, "o-o");
+ mstrlcpy(m->algString, "O-O", sizeof(m->algString));
+ mstrlcpy(m->moveString, "o-o", sizeof(m->moveString));
} else if (PieceChar == 'K' &&
m->fromFile == 4 &&
m->toFile == 2) {
- strcpy(m->algString, "O-O-O");
- strcpy(m->moveString, "o-o-o");
+ mstrlcpy(m->algString, "O-O-O", sizeof(m->algString));
+ mstrlcpy(m->moveString, "o-o-o", sizeof(m->moveString));
} else {
i = 0;
m->algString[i++] = PieceChar;