96936acd99
---- IRC log started Tue Sep 21 22:27 [Sep 21 22:27] *** Value of LOG set to ON [Sep 21 22:27] > hello [Sep 21 22:27] -> *drahn* hello [Sep 21 22:28] *drahn* helloback IRC log ended Tue Sep 21 22:28 ---- From drahn@
22 lines
466 B
Plaintext
22 lines
466 B
Plaintext
$OpenBSD: patch-source_log_c,v 1.1 2004/11/02 03:26:26 brad Exp $
|
|
--- source/log.c.orig Tue Jan 6 00:42:16 2004
|
|
+++ source/log.c Tue Sep 21 22:26:52 2004
|
|
@@ -172,9 +172,16 @@ add_to_log(fp, line)
|
|
FILE *fp;
|
|
u_char *line;
|
|
{
|
|
+ time_t t;
|
|
+ struct tm *tm;
|
|
+ char buf[32];
|
|
+
|
|
if (fp)
|
|
{
|
|
- fprintf(fp, "%s\n", line);
|
|
+ t = time(0);
|
|
+ tm = localtime(&t);
|
|
+ strftime(buf, sizeof buf, "%b %d %R", tm);
|
|
+ fprintf(fp, "[%s] %s\n", buf, line);
|
|
fflush(fp);
|
|
}
|
|
}
|