summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-05-07 01:33:35 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-05-07 01:33:35 (EDT)
commiteb039d67a791638cf000ccec889bdc9026a07fa7 (patch)
tree916cf45f607372b69e2f295ce6899148517ce226
parent197411623bf69b3046a25ed44d63fc7e245ac7e3 (diff)
ustar: Make mtime unsigned
-rw-r--r--src/opk/read.c2
-rw-r--r--src/opk/write.c4
-rw-r--r--src/ustar.c2
-rw-r--r--src/ustar.h4
4 files changed, 6 insertions, 6 deletions
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,