aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h264.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-03-01 17:23:39 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-03-01 17:23:39 +0000
commitb091b8d26cf290d1f4fdf41820f01e87bb6b7d6d (patch)
tree75b52bc6b03f8df488b8acbe97063df9d6d8b02d /epan/dissectors/packet-h264.c
parent346d46b8d020d0b5bdd9757622cdec2625349a10 (diff)
Rewrote to use g_strlcpy and g_strlcat.
svn path=/trunk/; revision=24525
Diffstat (limited to 'epan/dissectors/packet-h264.c')
-rw-r--r--epan/dissectors/packet-h264.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c
index 3a19158a53..761a6d794f 100644
--- a/epan/dissectors/packet-h264.c
+++ b/epan/dissectors/packet-h264.c
@@ -40,6 +40,7 @@
#include <epan/packet.h>
#include <epan/proto.h>
#include <epan/asn1.h>
+#include <epan/strutil.h>
#include "prefs.h"
@@ -346,25 +347,25 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
str[0]='\0';
for(bit=0;bit<((int)(bit_offset&0x07));bit++){
if(bit&&(!(bit%4))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
- strcat(str,".");
+ g_strlcat(str,".", 256);
}
leading_zero_bits = -1;
for( b = 0; !b; leading_zero_bits++ ){
if(bit&&(!(bit%4))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
if(bit&&(!(bit%8))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
b = tvb_get_bits8(tvb, bit_offset, 1);
if(b != 0){
- strcat(str, "1");
+ g_strlcat(str, "1", 256);
} else {
- strcat(str, "0");
+ g_strlcat(str, "0", 256);
}
bit++;
bit_offset++;
@@ -375,13 +376,13 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
*start_bit_offset = bit_offset;
for(;bit%8;bit++){
if(bit&&(!(bit%4))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
- strcat(str,".");
+ g_strlcat(str,".", 256);
}
if(hf_field){
- strcat(str," = ");
- strcat(str,hf_field->name);
+ g_strlcat(str," = ", 256);
+ g_strlcat(str,hf_field->name, 256);
switch (descriptor){
case H264_SE_V:
/* if the syntax element is coded as se(v),
@@ -471,25 +472,25 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
/* read the bits for the int */
for(i=0;i<leading_zero_bits;i++){
if(bit&&(!(bit%4))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
if(bit&&(!(bit%8))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
bit++;
tmp = value & mask;
if(tmp != 0){
- strcat(str, "1");
+ g_strlcat(str, "1", 256);
} else {
- strcat(str, "0");
+ g_strlcat(str, "0", 256);
}
mask = mask>>1;
}
for(;bit%8;bit++){
if(bit&&(!(bit%4))){
- strcat(str, " ");
+ g_strlcat(str, " ", 256);
}
- strcat(str,".");
+ g_strlcat(str,".", 256);
}
switch (descriptor){
@@ -511,11 +512,11 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
}
if(hf_field){
- strcat(str," = ");
- strcat(str,hf_field->name);
+ g_strlcat(str," = ", 256);
+ g_strlcat(str,hf_field->name, 256);
switch (descriptor){
case H264_SE_V:
- strcat(str,"(se(v))");
+ g_strlcat(str,"(se(v))", 256);
/* if the syntax element is coded as se(v),
* the value of the syntax element is derived by invoking the
* mapping process for signed Exp-Golomb codes as specified in