COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 02-07-2008, 08:01 PM   #1
tgehrig
Human being with feelings
 
Join Date: Nov 2006
Posts: 24
Default offset in month in server log file

Hi,
I don't know if this is already known. I just looked had a look at the log file of the ninjam server and saw that the month is not correctly outputted. tm_mon starts with 0, meaning January. So there should be tm_mon+1 used in the output. The following patch fixes this. I have commited it to the ninjam version I maintain on gninjam.sf.net, but post it hear, so that Justin can merge that into the official branch;-).
Code:
--- ninjamsrv.cpp       (Revision 80)
+++ ninjamsrv.cpp       (Arbeitskopie)
@@ -653,7 +653,7 @@
       time_t tv;
       time(&tv);
       struct tm *t=localtime(&tv);
-      fprintf(g_logfp,"[%04d/%02d/%02d %02d:%02d:%02d] ",t->tm_year+1900,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
+      fprintf(g_logfp,"[%04d/%02d/%02d %02d:%02d:%02d] ",t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);
     }
tgehrig is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.