summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-10-23 00:35:42 -0500
committerDan McGee <dan@archlinux.org>2007-10-23 00:35:42 -0500
commitbd15c23e1690d0c85632d7950cd79d17c65a4e17 (patch)
tree0af8b00792235c32e443f5aa8728f4a99a2f423b /lib/libalpm/be_files.c
parent8b1fb61df26649e1dec626ef9120fc787a831fcc (diff)
downloadpacman-bd15c23e1690d0c85632d7950cd79d17c65a4e17.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_files.c')
-rw-r--r--lib/libalpm/be_files.c7
1 files changed, 3 insertions, 4 deletions
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 <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <stdint.h> /* uintmax_t */
#include <sys/stat.h>
#include <dirent.h>
#include <ctype.h>
#include <time.h>
-#ifdef CYGWIN
#include <limits.h> /* 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"