aboutsummaryrefslogtreecommitdiffstats
path: root/g10/encode.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-10-05 16:58:50 +0000
committerWerner Koch <[email protected]>2005-10-05 16:58:50 +0000
commitbd1df0119c26d14e298d11abdd07ae77e8fb124f (patch)
treeb536179161d11a20fd32df27971f65d952814a88 /g10/encode.c
parent2005-10-02 Marcus Brinkmann <[email protected]> (diff)
downloadgnupg-bd1df0119c26d14e298d11abdd07ae77e8fb124f.tar.gz
gnupg-bd1df0119c26d14e298d11abdd07ae77e8fb124f.zip
Renamed g10.c to gpg.c
Filelength fixes for W32.
Diffstat (limited to '')
-rw-r--r--g10/encode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/g10/encode.c b/g10/encode.c
index a4906d62d..5bbe7cf53 100644
--- a/g10/encode.c
+++ b/g10/encode.c
@@ -299,8 +299,10 @@ encode_simple( const char *filename, int mode, int use_seskey )
if ( !iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
{
off_t tmpsize;
+ int overflow;
- if ( !(tmpsize = iobuf_get_filelength(inp)) )
+ if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
+ && !overflow )
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 the
@@ -589,14 +591,16 @@ encode_crypt( const char *filename, STRLIST remusr, int use_symkey )
if (!iobuf_is_pipe_filename (filename) && *filename && !opt.textmode )
{
off_t tmpsize;
+ int overflow;
- if ( !(tmpsize = iobuf_get_filelength(inp)) )
+ if ( !(tmpsize = iobuf_get_filelength(inp, &overflow))
+ && !overflow )
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 the
size of a file is larger than 2^32 minus some bytes for
packet headers, we switch to partial length encoding. */
- if ( tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
+ if (tmpsize < (IOBUF_FILELENGTH_LIMIT - 65536) )
filesize = tmpsize;
else
filesize = 0;