aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-22 12:23:08 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-22 12:23:08 +0100
commitee5f54e2afef553dc190387e4efc668aca70f031 (patch)
tree91d93a615811a9ebdea012e6ff44999cbb53ae2c /src/util/common_logging.c
parent02132e8fc311b966154fd5d9f0b3686ea8c2bf86 (diff)
downloadgnunet-ee5f54e2afef553dc190387e4efc668aca70f031.tar.gz
gnunet-ee5f54e2afef553dc190387e4efc668aca70f031.zip
allow NULL argument for GNUNET_i2s()
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index dad5d3776..1da406753 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -1209,8 +1209,11 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
1209 static char buf[256]; 1209 static char buf[256];
1210 char *ret; 1210 char *ret;
1211 1211
1212 if (NULL == pid)
1213 return "NULL";
1212 ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); 1214 ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
1213 strcpy (buf, ret); 1215 strcpy (buf,
1216 ret);
1214 GNUNET_free (ret); 1217 GNUNET_free (ret);
1215 buf[4] = '\0'; 1218 buf[4] = '\0';
1216 return buf; 1219 return buf;
@@ -1234,8 +1237,11 @@ GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
1234 static char buf[256]; 1237 static char buf[256];
1235 char *ret; 1238 char *ret;
1236 1239
1240 if (NULL == pid)
1241 return "NULL";
1237 ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key); 1242 ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
1238 strcpy (buf, ret); 1243 strcpy (buf,
1244 ret);
1239 GNUNET_free (ret); 1245 GNUNET_free (ret);
1240 buf[4] = '\0'; 1246 buf[4] = '\0';
1241 return buf; 1247 return buf;