From: Nicholas Clark Date: Fri, 27 May 2005 18:54:36 +0000 (+0000) Subject: In assert(), we mustn't stringify the message as part of the first X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=60b9f5a768d813874b27945f3490540726428049;p=p5sagit%2Fp5-mst-13.2.git In assert(), we mustn't stringify the message as part of the first argument to croak, as it's a *printf format, and the thing we're asserting might itself contain % signs. Also, as __FILE__ is a string, we can append that to the format, rather than needing a %s for it. p4raw-id: //depot/perl@24609 --- diff --git a/perl.h b/perl.h index 9aaf7b4..7688d96 100644 --- a/perl.h +++ b/perl.h @@ -3191,8 +3191,8 @@ Gid_t getegid (void); #ifndef assert /* might have been included somehow */ #define assert(what) PERL_DEB( \ ((what) ? ((void) 0) : \ - (Perl_croak(aTHX_ "Assertion " STRINGIFY(what) " failed: file \"%s\", line %d", \ - __FILE__, __LINE__), \ + (Perl_croak(aTHX_ "Assertion %s failed: file \"" __FILE__ \ + "\", line %d", STRINGIFY(what), __LINE__), \ PerlProc_exit(1), \ (void) 0))) #endif