2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-30 18:38:52 +00:00

64-bit fix

git-svn-id: svn+q:///qpdf/trunk@610 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
Jay Berkenbilt 2008-05-05 02:08:26 +00:00
parent 470bb5b8be
commit bbdf4f4219

View File

@ -26,7 +26,7 @@ static unsigned int const key_bytes = 32;
void
pad_or_truncate_password(std::string const& password, char k1[key_bytes])
{
int password_bytes = std::min(key_bytes, password.length());
int password_bytes = std::min((size_t) key_bytes, password.length());
int pad_bytes = key_bytes - password_bytes;
memcpy(k1, password.c_str(), password_bytes);
memcpy(k1 + password_bytes, padding_string, pad_bytes);