From 949afd238531acb94f252c50b7e06d96c23ec042 Mon Sep 17 00:00:00 2001 From: James Golovich Date: Mon, 5 Apr 2004 08:22:14 +0000 Subject: [PATCH] Format q921 log string before printing. Fixes those annoying half patch packet decodes when logging data with something like script or tee git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@84 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q921.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/q921.c b/q921.c index 6a17deb..f857373 100755 --- a/q921.c +++ b/q921.c @@ -494,10 +494,14 @@ void q921_dump(q921_h *h, int len, int showraw, int txrx) direction_tag = txrx ? '>' : '<'; if (showraw) { - pri_message("\n%c [", direction_tag); - for (x=0;xraw[x]); - pri_message("]\n"); + char *buf = malloc(len * 3 + 1); + int buflen = 0; + if (buf) { + for (x=0;xraw[x]); + pri_message("\n%c [ %s]\n", direction_tag, buf); + free(buf); + } } switch (h->h.data[0] & Q921_FRAMETYPE_MASK) {