First uC-compilable version, not tested yet
[efax.git] / efaxmsg.c
index 068f5f1..cacbeb1 100644 (file)
--- a/efaxmsg.c
+++ b/efaxmsg.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <ctype.h>             /* ANSI C */
 #include <errno.h>
 #include <stdio.h>
@@ -34,16 +36,14 @@ extern char *strerror( int i )
 
 /* Print time stamp. */
 
-time_t tstamp ( time_t last, FILE *f )
+static time_t tstamp ( time_t last, FILE *f )
 {
-  time_t now ;
-  char tbuf [ MAXTSTAMP ] ;
+       time_t now = time ( NULL );
 
-  now = time ( 0 ) ;
+       if ( ! last )
+    last = now;
 
-  strftime ( tbuf, MAXTSTAMP,  ( now - last > 600 ) ? "%c" : "%M:%S",
-           localtime( &now ) ) ;
-  fputs ( tbuf, f ) ;
+       printf ( "+%03ld", (long)(now - last) );
 
   return now ;
 }