diff options
author | Jay Berkenbilt <ejb@ql.org> | 2012-06-20 17:20:57 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-06-20 21:20:26 +0200 |
commit | 5d4cad9c02e9d4f31477fed0e3b20b35c83936f8 (patch) | |
tree | 38768f5e4a797e09de304b1e184021f5b280da29 /libqpdf/MD5.cc | |
parent | 24e2b2b76f1f0051f240c8371b2352c4cde85bf9 (diff) | |
download | qpdf-5d4cad9c02e9d4f31477fed0e3b20b35c83936f8.tar.zst |
ABI change: fix use of off_t, size_t, and integer types
Significantly improve the code's use of off_t for file offsets, size_t
for memory sizes, and integer types in cases where there has to be
compatibility with external interfaces. Rework sections of the code
that would have prevented qpdf from working on files larger than 2 (or
maybe 4) GB in size.
Diffstat (limited to 'libqpdf/MD5.cc')
-rw-r--r-- | libqpdf/MD5.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/MD5.cc b/libqpdf/MD5.cc index f00dbe4b..70be696d 100644 --- a/libqpdf/MD5.cc +++ b/libqpdf/MD5.cc @@ -308,7 +308,7 @@ void MD5::reset() void MD5::encodeString(char const* str) { - unsigned int len = strlen(str); + unsigned int len = (unsigned int)strlen(str); update((unsigned char *)str, len); final(); @@ -316,7 +316,7 @@ void MD5::encodeString(char const* str) void MD5::appendString(char const* input_string) { - update((unsigned char *)input_string, strlen(input_string)); + update((unsigned char *)input_string, (unsigned int) strlen(input_string)); } void MD5::encodeDataIncrementally(char const* data, int len) @@ -332,7 +332,7 @@ void MD5::encodeFile(char const *filename, int up_to_size) std::string("MD5: open ") + filename, fopen(filename, "rb")); - int len; + size_t len; int so_far = 0; int to_try = 1024; do @@ -344,7 +344,7 @@ void MD5::encodeFile(char const *filename, int up_to_size) len = fread(buffer, 1, to_try, file); if (len > 0) { - update(buffer, len); + update(buffer, (unsigned int) len); so_far += len; if ((up_to_size >= 0) && (so_far >= up_to_size)) { |