[libpri-commits] branch 1.2 r345 - /branches/1.2/q931.c
libpri-commits at lists.digium.com
libpri-commits at lists.digium.com
Fri Jun 2 07:33:51 MST 2006
Author: mattf
Date: Fri Jun 2 09:33:50 2006
New Revision: 345
URL: http://svn.digium.com/view/libpri?rev=345&view=rev
Log:
Fix for 7115 (Don't call pri_message multiple times per line)
Modified:
branches/1.2/q931.c
Modified: branches/1.2/q931.c
URL: http://svn.digium.com/view/libpri/branches/1.2/q931.c?rev=345&r1=344&r2=345&view=diff
==============================================================================
--- branches/1.2/q931.c (original)
+++ branches/1.2/q931.c Fri Jun 2 09:33:50 2006
@@ -2070,15 +2070,17 @@
unsigned int x;
int full_ie = Q931_FULL_IE(codeset, ie->ie);
int base_ie;
-
- pri_message(NULL, "%c [", prefix);
- pri_message(NULL, "%02x", ie->ie);
+ char *buf = malloc(ielen(ie) * 3 + 1);
+ int buflen = 0;
+
+ buf[0] = '\0';
if (!(ie->ie & 0x80)) {
- pri_message(NULL, " %02x", ielen(ie)-2);
+ buflen += sprintf(buf, " %02x", ielen(ie)-2);
for (x = 0; x + 2 < ielen(ie); ++x)
- pri_message(NULL, " %02x", ie->data[x]);
- }
- pri_message(NULL, "]\n");
+ buflen += sprintf(buf + buflen, " %02x", ie->data[x]);
+ }
+ pri_message(pri, "%c [%02x%s]\n", prefix, ie->ie, buf);
+ free(buf);
/* Special treatment for shifts */
if((full_ie & 0xf0) == Q931_LOCKING_SHIFT)
More information about the libpri-commits
mailing list