]> jfr.im git - irc/quakenet/newserv.git/commitdiff
PROXYSCAN: format time in spew output
authorGunnar Beutner <redacted>
Sat, 17 Aug 2013 11:56:16 +0000 (13:56 +0200)
committerGunnar Beutner <redacted>
Sat, 17 Aug 2013 11:56:16 +0000 (13:56 +0200)
proxyscan/proxyscandb.c

index c378c726e2b6c46ea7980888190dd991bd1c6271..f3ee2d784f40adbd210d0794ac49507a9585bc71 100644 (file)
@@ -223,6 +223,7 @@ int proxyscandolistopen(void *sender, int cargc, char **cargv) {
 void proxyscanspewip_real(DBConn *dbconn, void *arg) {
   nick *np=getnickbynumeric((unsigned long)arg);
   DBResult *pgres;
+  char timebuf[30];
 
   pgres=dbgetresult(dbconn);
   if (!dbquerysuccessful(pgres)) {
@@ -243,9 +244,12 @@ void proxyscanspewip_real(DBConn *dbconn, void *arg) {
 
   sendnoticetouser(proxyscannick,np,"%-5s %-20s %-22s %s","ID","IP","Found at","What was open");
   while(dbfetchrow(pgres)) {
+    time_t t = strtoul(dbgetvalue(pgres, 2), NULL, 10);
+    strftime(timebuf, sizeof(timebuf), "%d/%m/%y %H:%M GMT", gmtime(&t));
+
     sendnoticetouser(proxyscannick,np, "%-5s %-20s %-22s %s",dbgetvalue(pgres, 0),
                                                              dbgetvalue(pgres, 1),
-                                                             dbgetvalue(pgres, 2),
+                                                             timebuf,
                                                             dbgetvalue(pgres, 3));
   }
   dbclear(pgres);