From eb039d67a791638cf000ccec889bdc9026a07fa7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 07 May 2023 01:33:35 -0400 Subject: ustar: Make mtime unsigned --- diff --git a/src/opk/read.c b/src/opk/read.c index 97187dc..0a7f3c1 100644 --- a/src/opk/read.c +++ b/src/opk/read.c @@ -414,7 +414,7 @@ _opkg_opk_opk_read_data(struct opkg_opk_opk *opk) if (member->mode & 01000) mode[8] = 't'; mode[9] = '\0'; strftime(mtime, sizeof(mtime), "%Y-%m-%d %H:%M:%S", - localtime(&member->mtime)); + localtime((const time_t *) &member->mtime)); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" if (printf(fmt, member->type, mode, diff --git a/src/opk/write.c b/src/opk/write.c index 93ddc74..5ddd502 100644 --- a/src/opk/write.c +++ b/src/opk/write.c @@ -43,7 +43,7 @@ _opkg_opk_opk_write_file(void *user_data, size_t size) } static int -_opkg_opk_opk_source_date_epoch(int64_t *mtime) +_opkg_opk_opk_source_date_epoch(uint64_t *mtime) { char *env; char *end; @@ -63,7 +63,7 @@ int opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name) { int ret; - int64_t mtime; + uint64_t mtime; struct opkg_opk_dirent dirent; char *buffer; size_t size; diff --git a/src/ustar.c b/src/ustar.c index f67c0e9..7ad7da8 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -280,7 +280,7 @@ int opkg_opk_ustar_write_header(struct opkg_opk_ustar *ustar, struct opkg_opk_dirent *dirent, uint16_t mode, uid_t uid, const char *uname, gid_t gid, const char *gname, - uint64_t size, int64_t mtime, char type, const char *linkname) + uint64_t size, uint64_t mtime, char type, const char *linkname) { uint32_t chksum; size_t i; diff --git a/src/ustar.h b/src/ustar.h index 57e6458..8dfd771 100644 --- a/src/ustar.h +++ b/src/ustar.h @@ -35,7 +35,7 @@ struct opkg_opk_ustar_member { char name [OPKG_OPK_USTAR_NAME_SIZE]; uint16_t mode; uint64_t size; - int64_t mtime; + uint64_t mtime; char type; char linkname[OPKG_OPK_USTAR_LINKNAME_SIZE]; char uname [32]; @@ -91,7 +91,7 @@ int opkg_opk_ustar_write_header(struct opkg_opk_ustar *ustar, struct opkg_opk_dirent *dirent, uint16_t mode, uid_t uid, const char *uname, gid_t gid, const char *gname, - uint64_t size, int64_t mtime, char type, const char *linkname); + uint64_t size, uint64_t mtime, char type, const char *linkname); int opkg_opk_ustar_get_buffer(struct opkg_opk_ustar *ustar, char **buffer, -- cgit v0.9.1