diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:24:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:24:12 +0000 |
commit | 427dd6f998fb1fde515a3b5c800f9f6d308197b2 (patch) | |
tree | 8cbe9bf7b43fafae07ed1a25753ccccdbe430148 /src/util/common_logging.c | |
parent | b18fa7b1e7fcb4d48e2ef314a7d822ccddd8bd60 (diff) | |
download | gnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.tar.gz gnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.zip |
-towards addressing #3047, note this causes the code to FTBFS
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 0c9973d44..6493aae38 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -25,7 +25,6 @@ | |||
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_common.h" | ||
29 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
30 | #include <regex.h> | 29 | #include <regex.h> |
31 | 30 | ||
@@ -1082,16 +1081,19 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc) | |||
1082 | * | 1081 | * |
1083 | * @param pid the peer identity | 1082 | * @param pid the peer identity |
1084 | * @return string form of the pid; will be overwritten by next | 1083 | * @return string form of the pid; will be overwritten by next |
1085 | * call to GNUNET_i2s. | 1084 | * call to #GNUNET_i2s. |
1086 | */ | 1085 | */ |
1087 | const char * | 1086 | const char * |
1088 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | 1087 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) |
1089 | { | 1088 | { |
1090 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1089 | static char buf[256]; |
1091 | 1090 | char *ret; | |
1092 | GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); | 1091 | |
1093 | ret.encoding[4] = '\0'; | 1092 | ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key); |
1094 | return (const char *) ret.encoding; | 1093 | strcpy (buf, ret); |
1094 | GNUNET_free (ret); | ||
1095 | buf[4] = '\0'; | ||
1096 | return buf; | ||
1095 | } | 1097 | } |
1096 | 1098 | ||
1097 | 1099 | ||
@@ -1102,15 +1104,18 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | |||
1102 | * | 1104 | * |
1103 | * @param pid the peer identity | 1105 | * @param pid the peer identity |
1104 | * @return string form of the pid; will be overwritten by next | 1106 | * @return string form of the pid; will be overwritten by next |
1105 | * call to GNUNET_i2s. | 1107 | * call to #GNUNET_i2s_full. |
1106 | */ | 1108 | */ |
1107 | const char * | 1109 | const char * |
1108 | GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid) | 1110 | GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid) |
1109 | { | 1111 | { |
1110 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1112 | static char buf[256]; |
1113 | char *ret; | ||
1111 | 1114 | ||
1112 | GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); | 1115 | ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key); |
1113 | return (const char *) ret.encoding; | 1116 | strcpy (buf, ret); |
1117 | GNUNET_free (ret); | ||
1118 | return buf; | ||
1114 | } | 1119 | } |
1115 | 1120 | ||
1116 | 1121 | ||