This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix the handling of string precision in pretty printer (PR 81586)


On 07/27/2017 05:29 PM, Martin Sebor wrote:
> The pretty printer treats precision in %s directives as a request
> to print exactly as many characters from the string argument when
> what precision normally (in C) means is the maximum number of
> characters to read from the string.  It doesn't mean to read
> past the terminating NUL.
> 
> The attached patch fixes that.  Tested on x86_64-linux.
> 
> Martin
> 
> gcc-81586.diff
> 
> 
> PR c++/81586 - valgrind error in output_buffer_append_r with -Wall
> 
> gcc/ChangeLog:
> 
> 	PR c++/81586
> 	* pretty-print.c (pp_format): Correct the handling of %s precision.
OK.
jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]