diff options
author | Werner Koch <[email protected]> | 2023-07-04 15:37:54 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2023-07-04 15:37:54 +0000 |
commit | 334f5d95c825f5c8a0785f6ab7cb6f7e94269a81 (patch) | |
tree | ef15051d5b299885684c77f876ddbd374b8e5cde /g10/encrypt.c | |
parent | agent: Fix formatting thread ID of nPth. (diff) | |
parent | Post release updates (diff) | |
download | gnupg-334f5d95c825f5c8a0785f6ab7cb6f7e94269a81.tar.gz gnupg-334f5d95c825f5c8a0785f6ab7cb6f7e94269a81.zip |
Merge branch 'STABLE-BRANCH-2-4' into master
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r-- | g10/encrypt.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c index 00d9a0c44..b335b9797 100644 --- a/g10/encrypt.c +++ b/g10/encrypt.c @@ -559,12 +559,12 @@ encrypt_simple (const char *filename, int mode, int use_seskey) if ( !iobuf_is_pipe_filename (filename) && *filename && !opt.textmode ) { - off_t tmpsize; - int overflow; + uint64_t tmpsize; - if ( !(tmpsize = iobuf_get_filelength(inp, &overflow)) - && !overflow && opt.verbose) + tmpsize = iobuf_get_filelength(inp); + if (!tmpsize && opt.verbose) log_info(_("WARNING: '%s' is an empty file\n"), filename ); + /* We can't encode the length of very large files because OpenPGP uses only 32 bit for file sizes. So if the size of a file is larger than 2^32 minus some bytes for @@ -903,11 +903,10 @@ encrypt_crypt (ctrl_t ctrl, int filefd, const char *filename, if (filename && *filename && !iobuf_is_pipe_filename (filename) && !opt.textmode ) { - off_t tmpsize; - int overflow; + uint64_t tmpsize; - if ( !(tmpsize = iobuf_get_filelength(inp, &overflow)) - && !overflow && opt.verbose) + tmpsize = iobuf_get_filelength (inp); + if (!tmpsize && opt.verbose) log_info(_("WARNING: '%s' is an empty file\n"), filename ); /* We can't encode the length of very large files because OpenPGP uses only 32 bit for file sizes. So if the size |