]> git.pond.sub.org Git - empserver/commitdiff
(gamedown): Printed down message with pr(), as a printf()-like format
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Aug 2004 13:34:41 +0000 (13:34 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Aug 2004 13:34:41 +0000 (13:34 +0000)
string!  This reads and formats junk from the stack when message
contains '%', and can even crash.  Use prnf() instead.  Catched by Ron
Koenderink.

src/lib/player/empdis.c

index 5c63ca32dfac5a8ce023f48b12f32573938b0bc9..7d9c664516447f5a829e4a31ac39453408a2e8fc 100644 (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;