diff options
author | Allan McRae <allan@archlinux.org> | 2022-07-21 19:50:10 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2022-07-21 19:50:10 +1000 |
commit | 7bcc2d9b233dea3d7ed3824cc33d635d024d0784 (patch) | |
tree | 5ecb0b6b725e59fda90ea990ee0d6f2135da9f5b | |
parent | 819a0c29867e3a13abddaa4680defb3399f772ef (diff) |
Correctly handle failure in getting build or install dates
alpm_pkg_get_builddate() and alpm_pkg_get_installdate() both return -1 on
error. Correctly handle the error condition in pacman.
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | src/pacman/package.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c index f2b6fa19..4fcc11f2 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -210,11 +210,11 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra) /* set variables here, do all output below */ bdate = (time_t)alpm_pkg_get_builddate(pkg); - if(bdate) { + if(bdate != -1) { strftime(bdatestr, 50, "%c", localtime(&bdate)); } idate = (time_t)alpm_pkg_get_installdate(pkg); - if(idate) { + if(idate != -1) { strftime(idatestr, 50, "%c", localtime(&idate)); } |