From: havoc Date: Sat, 22 Dec 2007 03:05:34 +0000 (+0000) Subject: fix sprintf for savegame comment to not overflow on long map titles X-Git-Tag: xonotic-v0.1.0preview~2657 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffb182aefe5ef848e0ea91543bb74eea7ddb2e69;p=xonotic%2Fdarkplaces.git fix sprintf for savegame comment to not overflow on long map titles git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7834 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index da449a67..17e30e85 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -499,7 +499,7 @@ void Host_Savegame_f (void) FS_Printf(f, "%i\n", SAVEGAME_VERSION); memset(comment, 0, sizeof(comment)); - sprintf(comment, "%-21s kills:%3i/%3i", PRVM_GetString(prog->edicts->fields.server->message), (int)prog->globals.server->killed_monsters, (int)prog->globals.server->total_monsters); + sprintf(comment, "%-21.21s kills:%3i/%3i", PRVM_GetString(prog->edicts->fields.server->message), (int)prog->globals.server->killed_monsters, (int)prog->globals.server->total_monsters); // convert space to _ to make stdio happy // LordHavoc: convert control characters to _ as well for (i=0 ; i