On Jan 25, 2010, at 1:11 PM, Brian Oleksa wrote:

>                    char flowname[9];
>                    strncpy(flowname, ptr, 8);
>                    flowname[8] = '\0';
>                    ptr += 8;
>                    proto_tree_add_uint_format(helen_sub_tree, 
> hf_helen_length, tvb, offset, 8, 0,
>                            "Flowname: %s", flowname);

It's a string, not a number, so don't use proto_tree_add_uint_format(), or any 
other proto_tree_add_uint routine.

If it's an 8-octet field containing a null-padded string (presumably the string 
can have 8 octets), you should use something such as

        proto_tree_add_string(helen_sub_tree, hf_helen_flowname, tvb, offset, 
8, flowname);

> In the developers README file... it tells you NOT to use strcpy...but 
> instead use g_snprintf().

It doesn't say "don't use strncpy()".

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to