aboutsummaryrefslogtreecommitdiffstats
path: root/packet-rsvp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-07 19:10:51 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-07 19:10:51 +0000
commit068a2284863408fadf7cc972ad76961cb95d8823 (patch)
treeacac5925f569456d6b746c4d051c357f8d61244a /packet-rsvp.c
parent0bc96179d89d1c00516b68e47520486a6f7ba159 (diff)
Avoid using zero-length arrays - they're an extension that only some
compilers support, and at least some versions of HP's PA-RISC C compiler, for example (which people do use to compile Ethereal), don't support them. svn path=/trunk/; revision=1818
Diffstat (limited to 'packet-rsvp.c')
-rw-r--r--packet-rsvp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/packet-rsvp.c b/packet-rsvp.c
index 698666938d..c69befea3b 100644
--- a/packet-rsvp.c
+++ b/packet-rsvp.c
@@ -3,7 +3,7 @@
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: packet-rsvp.c,v 1.18 2000/03/14 06:03:24 guy Exp $
+ * $Id: packet-rsvp.c,v 1.19 2000/04/07 19:10:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -554,8 +554,7 @@ static value_string adspec_params[] = {
typedef struct {
rsvp_object base;
- guint32 labels[0];
-} label;
+} label; /* array of 32-bit labels follows */
typedef struct {
rsvp_object base;
@@ -569,8 +568,7 @@ typedef struct {
guint8 hold_prio;
guint8 flags;
guint8 name_len;
- guint8 name[0];
-} session_attribute;
+} session_attribute; /* name follows, as string */
static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
{IP_PROTO_IGMP, "IGMP"},
@@ -1750,7 +1748,7 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
proto_tree_add_text(rsvp_object_tree, offset2+3, 1,
"Name length: %d", s_attr->name_len);
memset(s_name, 0, 64);
- strncpy(s_name, s_attr->name, 60);
+ strncpy(s_name, &pd[offset2+4], 60);
if (s_attr->name_len>60) sprintf(&(s_name[60]), "...");
proto_tree_add_text(rsvp_object_tree, offset2+4, s_attr->name_len,
"Name: %s", s_name);