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

Jeff Law law@redhat.com
Wed Aug 2 19:03:00 GMT 2017


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




More information about the Gcc-patches mailing list