From 6f884890eb4cfc7d2faa6f57cbc3e773b722898e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 14 Aug 2010 21:33:12 +0000 Subject: fix --- src/util/common_logging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/common_logging.c b/src/util/common_logging.c index aa051333b..e05600986 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -473,6 +473,7 @@ const char * GNUNET_h2s (const GNUNET_HashCode * hc) { static struct GNUNET_CRYPTO_HashAsciiEncoded ret; + GNUNET_CRYPTO_hash_to_enc (hc, &ret); ret.encoding[8] = '\0'; return (const char *) ret.encoding; @@ -490,8 +491,9 @@ const char * GNUNET_h2s_full (const GNUNET_HashCode * hc) { static struct GNUNET_CRYPTO_HashAsciiEncoded ret; + GNUNET_CRYPTO_hash_to_enc (hc, &ret); - ret.encoding[104] = '\0'; + ret.encoding[sizeof(ret)-1] = '\0'; return (const char *) ret.encoding; } @@ -508,6 +510,7 @@ const char * GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) { static struct GNUNET_CRYPTO_HashAsciiEncoded ret; + GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); ret.encoding[4] = '\0'; return (const char *) ret.encoding; -- cgit v1.2.3