]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix sprintf for savegame comment to not overflow on long map titles
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 22 Dec 2007 03:05:34 +0000 (03:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 22 Dec 2007 03:05:34 +0000 (03:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7834 d7cf8633-e32d-0410-b094-e92efae38249

host_cmd.c

index da449a672a35acfa2e2a1f77c4448e5b8e25b7b0..17e30e8510df8d4fa1c7672b5549ac7438dca7ed 100644 (file)
@@ -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<SAVEGAME_COMMENT_LENGTH ; i++)