comparison rogue5/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 24e6beb9e7aa
children 0250220d8cdd
comparison
equal deleted inserted replaced
111:7f8f43943b1f 112:ee250e3646fd
224 } 224 }
225 225
226 void writelog(int amount, int flags, int monst) 226 void writelog(int amount, int flags, int monst)
227 { 227 {
228 #ifdef LOGFILE 228 #ifdef LOGFILE
229 char logmessage[160], ltemp[80]; 229 char logmessage[220], ltemp[80];
230 230
231 if (logfi == NULL) 231 if (logfi == NULL)
232 return; 232 return;
233 #ifdef MASTER 233 #ifdef MASTER
234 if (wizard) 234 if (wizard)
235 { 235 {
236 fclose(logfi); 236 fclose(logfi);
237 return; 237 return;
238 } 238 }
239 #endif 239 #endif
240 sprintf(logmessage, "%d %d %.20s %d ", time(NULL), amount, whoami, 240 sprintf(logmessage, "%d %d %.80s %d ", time(NULL), amount, whoami,
241 pstats.s_lvl); 241 pstats.s_lvl);
242 if (flags == 0) /* dead */ 242 if (flags == 0) /* dead */
243 { 243 {
244 sprintf(ltemp, "killed by %s on level %d\n", killname(monst, TRUE), 244 sprintf(ltemp, "killed by %s on level %d\n", killname(monst, TRUE),
245 level); 245 level);