1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2021-06-09 17:47:45 +02:00
parent 7a80004d54
commit 14e36bdbe1
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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)