From ffb182aefe5ef848e0ea91543bb74eea7ddb2e69 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 22 Dec 2007 03:05:34 +0000 Subject: [PATCH] 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 --- host_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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