mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-22 03:21:45 +01:00
Migrated away from using asctime() and ctime() - in favor of strftime().
Added year to several datestamps. Unbounded dates are locale-specific. - Minor re-formatting was needed for STAT PLAYER and SHOW PLAYER. The 'slay' feature of do_kill now requires a GRGOD or higher. 'last *' and 'last all' are now synonyms.
This commit is contained in:
@@ -196,7 +196,7 @@ int strn_cmp(const char *arg1, const char *arg2, int n)
|
||||
void basic_mud_vlog(const char *format, va_list args)
|
||||
{
|
||||
time_t ct = time(0);
|
||||
char *time_s = asctime(localtime(&ct));
|
||||
char timestr[20];
|
||||
|
||||
if (logfile == NULL) {
|
||||
puts("SYSERR: Using log() before stream was initialized!");
|
||||
@@ -206,9 +206,9 @@ void basic_mud_vlog(const char *format, va_list args)
|
||||
if (format == NULL)
|
||||
format = "SYSERR: log() received a NULL format.";
|
||||
|
||||
time_s[strlen(time_s) - 1] = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%b %d %H:%M:%S %Y", localtime(&ct));
|
||||
|
||||
fprintf(logfile, "%-15.15s :: ", time_s + 4);
|
||||
fprintf(logfile, "%-20.20s :: ", timestr);
|
||||
vfprintf(logfile, format, args);
|
||||
fputc('\n', logfile);
|
||||
fflush(logfile);
|
||||
|
||||
Reference in New Issue
Block a user