[Asterisk-cvs] libpri q931.c,1.65,1.66
citats at lists.digium.com
citats at lists.digium.com
Thu Jun 10 01:47:41 CDT 2004
Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/home/citats/cvs/libpri
Modified Files:
q931.c
Log Message:
Make q931.c:dump_display build the string first then print it in one command. Fixes remote console ugliness
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- q931.c 10 Jun 2004 03:57:43 -0000 1.65
+++ q931.c 10 Jun 2004 06:51:01 -0000 1.66
@@ -1059,10 +1059,14 @@
static void dump_display(q931_ie *ie, int len, char prefix)
{
int x;
- pri_message("%c Display (len=%2d) [ ", prefix, ie->len);
- for (x=0;x<ie->len;x++)
- pri_message("%c", ie->data[x] & 0x7f);
- pri_message(" ]\n");
+ char *buf = malloc(len + 1);
+
+ if (buf) {
+ for (x=0; x<ie->len; x++)
+ sprintf(&buf[x], "%c", ie->data[x] & 0x7f);
+ pri_message("%c Display (len=%2d) [ %s ]\n", prefix, ie->len, buf);
+ free(buf);
+ }
}
static void dump_ie_data(unsigned char *c, int len)
More information about the svn-commits
mailing list