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 /include | |
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 'include')
-rw-r--r-- | include/qpdf/QUtil.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index ddba97de..9639917d 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -56,6 +56,12 @@ namespace QUtil QPDF_DLL char* copy_string(std::string const&); + // Returns lower-case hex-encoded version of the string, treating + // each character in the input string as unsigned. The output + // string will be twice as long as the input string. + QPDF_DLL + std::string hex_encode(std::string const&); + // Set stdin, stdout to binary mode QPDF_DLL void binary_stdout(); |