[exim-dev] [PATCH] use difftime(3) when printing time differ…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Daniel Golle
Date:  
À: exim-dev
Sujet: [exim-dev] [PATCH] use difftime(3) when printing time difference
There is no printf format defined for time_t. Use difftime(3) and
'%.0f' instead of '%d' when printing the difference between two time_t
values.
---
src/src/transports/smtp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index af2e1f2dd..7f720602c 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -938,7 +938,7 @@ if (  sx->early_pipe_active
     if (!(er = dbfn_read_enforce_length(dbm_file, ehlo_resp_key, sizeof(dbdata_ehlo_resp))))
       debug_printf("no ehlo-resp record!\n");
     else
-      debug_printf("ehlo-resp record is %d seconds old\n", time(NULL) - er->time_stamp);
+      debug_printf("ehlo-resp record is %.0f seconds old\n", difftime(time(NULL), er->time_stamp));
     }


dbfn_delete(dbm_file, ehlo_resp_key);
--
2.44.0


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/