summaryrefslogtreecommitdiffstats
path: root/src/log.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-11-12 15:04:27 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-11-12 15:04:27 +0100
commitbe929dbe2dffa82ca1f91538f56a1bb0490000bd (patch)
treebb51b76662ce49aab71af132487c28d8c664b3f0 /src/log.c
parent5ddca2604f03fc33a427ebd6e49fda7d6967f993 (diff)
downloadfastd-be929dbe2dffa82ca1f91538f56a1bb0490000bd.tar
fastd-be929dbe2dffa82ca1f91538f56a1bb0490000bd.zip
Use peer specifier from log instead of the peer name for the status output
This fixes a crash when status sockets are used with peers without names, but the JSON output format is changed: named peers will now use "<name>" as key instead of "name".
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 1559496..8e2fa56 100644
--- a/src/log.c
+++ b/src/log.c
@@ -92,7 +92,7 @@ size_t fastd_snprint_peer_address(char *buffer, size_t size, const fastd_peer_ad
}
/** Creates a string representation of a peer */
-static size_t snprint_peer_str(char *buffer, size_t size, const fastd_peer_t *peer) {
+size_t fastd_snprint_peer_str(char *buffer, size_t size, const fastd_peer_t *peer) {
if (peer) {
if (peer->name) {
return snprintf_safe(buffer, size, "<%s>", peer->name);
@@ -168,7 +168,7 @@ static int fastd_vsnprintf(char *buffer, size_t size, const char *format, va_lis
break;
case 'P':
- buffer += snprint_peer_str(buffer, buffer_end-buffer, va_arg(ap, const fastd_peer_t *));
+ buffer += fastd_snprint_peer_str(buffer, buffer_end-buffer, va_arg(ap, const fastd_peer_t *));
break;
case 'I':