From bd15c23e1690d0c85632d7950cd79d17c65a4e17 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 23 Oct 2007 00:35:42 -0500 Subject: Print and typecast time_t correctly The recommended C99 way to print the value of a time_t is to cast it to uintmax_t or intmax_t. Do this to ensure compatability with all platforms. Signed-off-by: Dan McGee --- lib/libalpm/be_files.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c index 59155cfe..793a5c63 100644 --- a/lib/libalpm/be_files.c +++ b/lib/libalpm/be_files.c @@ -27,13 +27,12 @@ #include #include #include +#include /* uintmax_t */ #include #include #include #include -#ifdef CYGWIN #include /* PATH_MAX */ -#endif /* libalpm */ #include "db.h" @@ -589,11 +588,11 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) } if(info->builddate) { fprintf(fp, "%%BUILDDATE%%\n" - "%lu\n\n", info->builddate); + "%ju\n\n", (uintmax_t)info->builddate); } if(info->installdate) { fprintf(fp, "%%INSTALLDATE%%\n" - "%lu\n\n", info->installdate); + "%ju\n\n", (uintmax_t)info->installdate); } if(info->packager[0]) { fprintf(fp, "%%PACKAGER%%\n" -- cgit v1.2.3-70-g09d2