X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=efaxmsg.c;fp=efaxmsg.c;h=cacbeb1964c99b17585185e37ad28e32780fc36e;hb=41bffa4095f9ead16643307f77645ac3a2db1ffe;hp=068f5f1f7288acc0a89baf8e37c6a640aee19914;hpb=9fa7a8f2e9a04a9d869d213fa612bd8b34c447d4;p=efax.git diff --git a/efaxmsg.c b/efaxmsg.c index 068f5f1..cacbeb1 100644 --- a/efaxmsg.c +++ b/efaxmsg.c @@ -1,3 +1,5 @@ +#include "config.h" + #include /* ANSI C */ #include #include @@ -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 ; }