comparison arogue5/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 88dc6813e36a
children 7faf4568c295
comparison
equal deleted inserted replaced
111:7f8f43943b1f 112:ee250e3646fd
612 logfi = fopen(LOGFILE, "a"); 612 logfi = fopen(LOGFILE, "a");
613 if (logfi == NULL) { 613 if (logfi == NULL) {
614 perror(LOGFILE); 614 perror(LOGFILE);
615 return; 615 return;
616 } 616 }
617 fprintf(logfi, "%d %d %.20s %d %s %d %d %d %c %s\n", time(NULL), amount, 617 fprintf(logfi, "%d %d %s %d %s %d %d %d %c %s\n", time(NULL), amount,
618 whoami, pstats.s_lvl, class, level, max_level, quest_item, had_quest, 618 whoami, pstats.s_lvl, class, level, max_level, quest_item, had_quest,
619 fate); 619 fate);
620 fclose(logfi); 620 fclose(logfi);
621 #endif 621 #endif
622 return; 622 return;