Make q931.c:dump_display build the string first then print it in one command. Fixes remote console ugliness
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@108 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
parent
818a8cb57a
commit
0933575a5d
12
q931.c
12
q931.c
@ -1059,10 +1059,14 @@ static void dump_time_date(q931_ie *ie, int len, char prefix)
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user