diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-01-25 14:59:55 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-03-04 22:45:15 +0100 |
commit | 32b62035ce9d5d07f7396cc50a0c38215f19c906 (patch) | |
tree | c7ade8bcf294574d731dc2bc7cdf42524ee023d2 /libqpdf/MD5.cc | |
parent | 9f1594656cc4702b4b0e99a2787e18e4b00d54d3 (diff) | |
download | qpdf-32b62035ce9d5d07f7396cc50a0c38215f19c906.tar.zst |
Replace many calls to sprintf with QUtil::hex_encode
Add QUtil::hex_encode to encode binary data has a hexadecimal string,
and use it in place of sprintf where possible.
Diffstat (limited to 'libqpdf/MD5.cc')
-rw-r--r-- | libqpdf/MD5.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libqpdf/MD5.cc b/libqpdf/MD5.cc index 70be696d..57bcc45f 100644 --- a/libqpdf/MD5.cc +++ b/libqpdf/MD5.cc @@ -386,16 +386,7 @@ void MD5::print() std::string MD5::unparse() { final(); - - char result[33]; - char* p = result; - unsigned int i; - for (i = 0; i < 16; ++i) - { - sprintf(p, "%02x", digest_val[i]); - p += 2; - } - return result; + return QUtil::hex_encode(std::string((char*)digest_val, 16)); } std::string |