diff rogue4/rip.c @ 112:ee250e3646fd

Don't truncate player name in savefile name or log message. The player name is stored in whoami[], which is length 80 in most games (1024 in rogue5). Only the first 10 chars were used to create file_name, because that buffer is the same length. Increasing the size of file_name to 256 permits using all of whoami. The name is also no longer truncated to 20 chars when writing the log. All games should now be able to handle 79-character names without collisions. Anything more would break save compatibility.
author John "Elwin" Edwards
date Sun, 23 Mar 2014 21:27:14 -0700
parents 0ef99244acb8
children 1b73a8641b37
line wrap: on
line diff
--- a/rogue4/rip.c	Wed Jan 08 16:44:16 2014 -0500
+++ b/rogue4/rip.c	Sun Mar 23 21:27:14 2014 -0700
@@ -239,7 +239,7 @@
 void writelog(int amount, int flags, char monst)
 {
     FILE *logfi;
-    char logmessage[160], ltemp[80];
+    char logmessage[220], ltemp[80];
     char *killer;
     if (noscore)
         return;
@@ -251,7 +251,7 @@
     if (logfi == NULL)
         return;
     /* otherwise writing should work */
-    sprintf(logmessage, "%d %d %.20s %d ", time(NULL), amount, whoami, 
+    sprintf(logmessage, "%d %d %s %d ", time(NULL), amount, whoami, 
             pstats.s_lvl);
     if (flags == 0) /* died */
     {