diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:32:42 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-27 08:32:42 -0400 |
commit | 027c255a4fa8dd8ab9cf433e6f9491ce7e5658aa (patch) | |
tree | eb5ab88d751ec975681ae748d441f44d4799bd63 /src/utils.h | |
parent | 7fae606d622d8cd463ce5f81f5d7872a4fdebc60 (diff) | |
parent | 3ea7fbd5f6db4d362af79953b23bacc904909cff (diff) | |
download | ledger-027c255a4fa8dd8ab9cf433e6f9491ce7e5658aa.tar.gz ledger-027c255a4fa8dd8ab9cf433e6f9491ce7e5658aa.tar.bz2 ledger-027c255a4fa8dd8ab9cf433e6f9491ce7e5658aa.zip |
Merge branch 'next'
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(); } |