Don't shoot asterisks off-screen on the join password screen

This commit is contained in:
fickleheart 2019-03-06 23:34:30 -06:00
parent ddf2db8a36
commit 18dba65f17

View file

@ -1207,11 +1207,11 @@ static inline void CL_DrawConnectionStatus(void)
{ {
case CL_CHALLENGE: case CL_CHALLENGE:
{ {
char asterisks[65]; char asterisks[33];
size_t sl = strlen(cl_challengepassword); size_t sl = min(32, strlen(cl_challengepassword));
memset(asterisks, '*', sl); memset(asterisks, '*', sl);
memset(asterisks+sl, 0, 65-sl); memset(asterisks+sl, 0, 33-sl);
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks); V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_MONOSPACE|V_ALLOWLOWERCASE, asterisks);