From f736b24935d66733e9a53798fbc87dbc8aff9fca Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 16 Sep 2012 11:27:08 +0000 Subject: -fixing #2546 --- src/core/gnunet-core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/core') diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c index ebdd8aab3..571a2a53d 100644 --- a/src/core/gnunet-core.c +++ b/src/core/gnunet-core.c @@ -110,7 +110,8 @@ monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_ATS_Information *ats, uint32_t ats_count) { struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); - char *now_str; + const char *now_str; + if (0 != memcmp (&my_id, peer, sizeof (my_id))) { monitor_connections_counter ++; @@ -120,8 +121,6 @@ monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, _("Connected to"), GNUNET_i2s (peer), monitor_connections_counter); - - GNUNET_free (now_str); } } @@ -137,21 +136,19 @@ static void monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) { struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); - char *now_str; + const char *now_str; if (0 != memcmp (&my_id, peer, sizeof (my_id))) { now_str = GNUNET_STRINGS_absolute_time_to_string (now); GNUNET_assert (monitor_connections_counter > 0); - monitor_connections_counter --; - + monitor_connections_counter--; FPRINTF (stdout, _("%24s: %-17s %4s (%u connections in total)\n"), now_str, _("Disconnected from"), GNUNET_i2s (peer), monitor_connections_counter); - GNUNET_free (now_str); } } -- cgit v1.2.3