From: Rafael Garcia-Suarez Date: Wed, 17 May 2006 19:55:30 +0000 (+0000) Subject: Parenthesize uses of macro arguments X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3749539d04912af50a86b1d1e5ae9962c3a882c;p=p5sagit%2Fp5-mst-13.2.git Parenthesize uses of macro arguments p4raw-id: //depot/perl@28217 --- diff --git a/perl.h b/perl.h index 2cf5a46..aa47dec 100644 --- a/perl.h +++ b/perl.h @@ -1460,7 +1460,7 @@ int sockatmark(int); #if defined(HAS_C99_VARIADIC_MACROS) && !(defined(DEBUGGING) && !defined(PERL_USE_GCC_BRACE_GROUPS)) # ifdef PERL_USE_GCC_BRACE_GROUPS -# define my_snprintf(buffer, len, ...) ({ int __len__ = snprintf(buffer, len, __VA_ARGS__); if (__len__ >= len) Perl_croak(aTHX_ "panic: snprintf buffer overflow"); __len__; }) +# define my_snprintf(buffer, len, ...) ({ int __len__ = snprintf(buffer, len, __VA_ARGS__); if (__len__ >= (len)) Perl_croak(aTHX_ "panic: snprintf buffer overflow"); __len__; }) # else # define my_snprintf(buffer, len, ...) snprintf(buffer, len, __VA_ARGS__) # endif @@ -1470,7 +1470,7 @@ int sockatmark(int); #if defined(HAS_C99_VARIADIC_MACROS) # ifdef PERL_USE_GCC_BRACE_GROUPS -# define my_vsnprintf(buffer, len, ...) ({ int __len__ = vsnprintf(buffer, len, __VA_ARGS__); if (__len__ >= len) Perl_croak(aTHX_ "panic: vsnprintf buffer overflow"); __len__; }) +# define my_vsnprintf(buffer, len, ...) ({ int __len__ = vsnprintf(buffer, len, __VA_ARGS__); if (__len__ >= (len)) Perl_croak(aTHX_ "panic: vsnprintf buffer overflow"); __len__; }) # else # define my_vsnprintf(buffer, len, ...) vsnprintf(buffer, len, __VA_ARGS__) # endif