diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-27 04:00:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-27 04:00:59 -0400 |
commit | ddfd00afe17393f5b33a9288990a649e3cfcc0ab (patch) | |
tree | d9562fba018f0a80809894e939b4026b235f4e37 /src/utils.h | |
parent | 5ddb0e9bfbf3432a1078adc550484e5b8a151f34 (diff) | |
download | fork-ledger-ddfd00afe17393f5b33a9288990a649e3cfcc0ab.tar.gz fork-ledger-ddfd00afe17393f5b33a9288990a649e3cfcc0ab.tar.bz2 fork-ledger-ddfd00afe17393f5b33a9288990a649e3cfcc0ab.zip |
Made the id function available in post contexts
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils.h b/src/utils.h index 98bdf9af..e3ae5dda 100644 --- a/src/utils.h +++ b/src/utils.h @@ -596,7 +596,7 @@ inline char peek_next_nonws(std::istream& in) { *_p = '\0'; \ } -inline string to_hex(uint_least32_t * message_digest) +inline string to_hex(uint_least32_t * message_digest, const int len = 1) { std::ostringstream buf; @@ -604,7 +604,8 @@ inline string to_hex(uint_least32_t * message_digest) buf.width(8); buf.fill('0'); buf << std::hex << message_digest[i]; - break; // only output the first dword + if (i + 1 >= len) + break; // only output the first LEN dwords } return buf.str(); } |