aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-05-22 11:45:10 -0700
committerGuy Harris <gharris@sonic.net>2021-05-22 11:45:10 -0700
commit10f36f219c46342af6399ea6e0d8106910b3e8f0 (patch)
tree593b6ab62e4a6158e04d0df68803d2a9026e6f67
parent66accecf3e8530647937b094fb3c9a3b93dfa28e (diff)
oran: clean up write_pdu_label_and_info().
Declare it as being printflike, so that the compiler does format-vs-argument-list checking. Fix the error that found. Make the string buffer into which it formats automatic, so that it's thread-safe.
-rwxr-xr-xepan/dissectors/packet-oran.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-oran.c b/epan/dissectors/packet-oran.c
index 95c690b023..4e2f53e4aa 100755
--- a/epan/dissectors/packet-oran.c
+++ b/epan/dissectors/packet-oran.c
@@ -352,6 +352,9 @@ static const range_string udCompParams[] = {
};
#endif
+static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2,
+ packet_info *pinfo, const char *format, ...) G_GNUC_PRINTF(4, 5);
+
/* Write the given formatted text to:
- the info column (if pinfo != NULL)
- 1 or 2 other labels (optional)
@@ -360,7 +363,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2,
packet_info *pinfo, const char *format, ...)
{
#define MAX_INFO_BUFFER 256
- static char info_buffer[MAX_INFO_BUFFER];
+ char info_buffer[MAX_INFO_BUFFER];
va_list ap;
if ((ti1 == NULL) && (ti2 == NULL) && (pinfo == NULL)) {
@@ -388,7 +391,7 @@ write_section_info(proto_item *section_heading, packet_info *pinfo, proto_item *
{
switch (num_prbx) {
case 0:
- write_pdu_label_and_info(section_heading, protocol_item, pinfo, ", Id: %d (all PRBs");
+ write_pdu_label_and_info(section_heading, protocol_item, pinfo, ", Id: %d (all PRBs", section_id);
break;
case 1:
write_pdu_label_and_info(section_heading, protocol_item, pinfo, ", Id: %d (PRB: %d)", section_id, start_prbx);