Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Properly initialise the timestamp to -1
Baptiste Daroussin committed 6 years ago
commit 01573dd3409aeb7bb5e8ecce8f029f66144d13c3
parent c107bc3
1 file changed +2 -3
modified libpkg/packing.c
@@ -61,8 +61,9 @@ packing_init(struct packing **pack, const char *path, pkg_formats format,
	assert(pack != NULL);

	*pack = xcalloc(1, sizeof(struct packing));
+
	(*pack)->timestamp = timestamp;

-
	if (timestamp == (time_t)-1 &&
+
	if ((*pack)->timestamp == (time_t)-1 &&
		(source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) {
			ts = (time_t)strtoimax(source_date_epoch, &endptr, 10);
			if (*endptr != '\0') {
@@ -71,8 +72,6 @@ packing_init(struct packing **pack, const char *path, pkg_formats format,
			} else {
				(*pack)->timestamp = ts;
			}
-
	} else {
-
		(*pack)->timestamp = timestamp;
	}

	(*pack)->aread = archive_read_disk_new();