aboutsummaryrefslogtreecommitdiffstats
path: root/tap-protohierstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tap-protohierstat.c')
-rw-r--r--tap-protohierstat.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tap-protohierstat.c b/tap-protohierstat.c
index fd8238a88c..7b79a70a8b 100644
--- a/tap-protohierstat.c
+++ b/tap-protohierstat.c
@@ -136,17 +136,23 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v
static void
phs_draw(phs_t *rs, int indentation)
{
- int i;
- char str[80];
+ int i, stroff;
+#define MAXPHSLINE 80
+ char str[MAXPHSLINE];
for(;rs;rs=rs->sibling){
if(rs->protocol==-1){
return;
}
str[0]=0;
+ stroff=0;
for(i=0;i<indentation;i++){
- strcat(str," ");
+ if(i>15){
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, "...");
+ break;
+ }
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, " ");
}
- strcat(str, rs->proto_name);
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, rs->proto_name);
printf("%-40s frames:%d bytes:%d\n",str, rs->frames, rs->bytes);
phs_draw(rs->child, indentation+1);
}