gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 08/19: allow NULL argument for GNUNET_i2s()


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 08/19: allow NULL argument for GNUNET_i2s()
Date: Sun, 22 Jan 2017 15:23:49 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit ee5f54e2afef553dc190387e4efc668aca70f031
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Jan 22 12:23:08 2017 +0100

    allow NULL argument for GNUNET_i2s()
---
 src/util/common_logging.c | 10 ++++++++--
 1 file 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)
   static char buf[256];
   char *ret;
 
+  if (NULL == pid)
+    return "NULL";
   ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
-  strcpy (buf, ret);
+  strcpy (buf,
+          ret);
   GNUNET_free (ret);
   buf[4] = '\0';
   return buf;
@@ -1234,8 +1237,11 @@ GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid)
   static char buf[256];
   char *ret;
 
+  if (NULL == pid)
+    return "NULL";
   ret = GNUNET_CRYPTO_eddsa_public_key_to_string (&pid->public_key);
-  strcpy (buf, ret);
+  strcpy (buf,
+          ret);
   GNUNET_free (ret);
   buf[4] = '\0';
   return buf;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]