(svn r767) Introduce USERSTRING_LEN (128) and try to make sure we don't overflow it anywhere (as long as we keep USERSTRING_LEN above 7 or so).

This commit is contained in:
pasky
2004-11-22 21:41:25 +00:00
parent d4b723a7c9
commit 3ee0dee12a
4 changed files with 7 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
}
DrawStringCentered(140, 38, str, 0);
sprintf(_userstring, "%.4X", lid->tile);
snprintf(_userstring, USERSTRING_LEN, "%.4X", lid->tile);
SET_DPARAM16(0, GET_TILE_X(lid->tile));
SET_DPARAM16(1, GET_TILE_Y(lid->tile));
SET_DPARAM16(2, STR_SPEC_USERSTRING);