From: Christian Grothoff Date: Sat, 14 Aug 2010 21:33:12 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~20705 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6f884890eb4cfc7d2faa6f57cbc3e773b722898e;p=oweals%2Fgnunet.git fix --- 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;