From a7a491b9f7c759130cf0684270baf5895f3aa2a3 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 3 Feb 2002 20:48:07 +0000 Subject: [PATCH] In C89, you can't declare variables at arbitrary points in code; move the declaration of "tmp" in the "OUT_STRING()" to the beginning of the block. svn path=/trunk/; revision=4691 --- packet-afs-macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packet-afs-macros.h b/packet-afs-macros.h index 65310a1f9e..d93558fd27 100644 --- a/packet-afs-macros.h +++ b/packet-afs-macros.h @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs-macros.h,v 1.15 2002/02/03 18:12:04 nneul Exp $ + * $Id: packet-afs-macros.h,v 1.16 2002/02/03 20:48:07 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -449,10 +449,10 @@ 4 bytes - length, then char data */ #define OUT_STRING(field) \ { int i,len; \ + char *tmp; \ i = tvb_get_ntohl(tvb, offset); \ offset += 4; \ len = ((i+4-1)/4)*4; \ - char *tmp; \ tmp = g_malloc(i+1); \ memcpy(tmp, tvb_get_ptr(tvb,offset,i), i); \ tmp[i] = '\0'; \