Wireshark mailing list archives
Re: Is there a need for a 0, NULL element at the end of value strings
From: Guy Harris <guy () alum mit edu>
Date: Tue, 16 Oct 2018 10:20:35 -0700
On Oct 16, 2018, at 8:30 AM, Richard Sharpe <realrichardsharpe () gmail com> wrote:
OK, ignore me. When you call g_array_new with TRUE in the first argument you get a ZERO entry on the end.
The fact that you had to ask this question - and probably had to look that up in the GLib documentation - suggests that there should be a comment before the g_array_new() call to indicate that the first argument being TRUE adds the necessary null terminator. (*I* certainly didn't remember that the argument to g_array_new() indicates whether to put a zero terminator into the array; I suspect few people who aren't heavy GLib developers would know that without looking it up.) ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Pascal Quantin (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Guy Harris (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Guy Harris (Oct 16)