(gamedown): Printed down message with pr(), as a printf()-like format

string!  This reads and formats junk from the stack when message
contains '%', and can even crash.  Use prnf() instead.  Catched by Ron
Koenderink.
This commit is contained in:
Markus Armbruster 2004-08-10 13:34:41 +00:00
parent 298ba998e4
commit a5a8b52afd

View file

@ -177,7 +177,7 @@ gamedown(void)
if (tgm.tel_length >= (long)sizeof(buf))
tgm.tel_length = sizeof(buf) - 1;
buf[tgm.tel_length] = 0;
pr(buf);
prnf(buf);
pr("\nThe game is down\n");
(void)close(downf);
return 1;