From 14e36bdbe1c39bc23e70db775e05319367ee8adb Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 9 Jun 2021 17:47:45 +0200 Subject: [PATCH] gpgtar,w32: Fix file size computation * tools/gpgtar-create.c (fillup_entry_w32): Move parentheses. -- Fixes-commit: 8b8925a2bdbb12dd537dde20a27cdb1416c2f1ae The bug is so obvious that I wonder why it was not reported more often on Windows. (Adding 1 to MAXDWORD (0xfffffff) always gives 0 for the product). Signed-off-by: Werner Koch --- tools/gpgtar-create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gpgtar-create.c b/tools/gpgtar-create.c index 6114d68ff..48c93da9c 100644 --- a/tools/gpgtar-create.c +++ b/tools/gpgtar-create.c @@ -148,7 +148,7 @@ fillup_entry_w32 (tar_header_t hdr) /* Only set the size for a regular file. */ if (hdr->typeflag == TF_REGULAR) - hdr->size = (fad.nFileSizeHigh * (unsigned long long)(MAXDWORD+1) + hdr->size = (fad.nFileSizeHigh * ((unsigned long long)MAXDWORD+1) + fad.nFileSizeLow); hdr->mtime = (((unsigned long long)fad.ftLastWriteTime.dwHighDateTime << 32)