From: <and...@us...> - 2012-08-13 21:30:07
|
Revision: 12209 http://plplot.svn.sourceforge.net/plplot/?rev=12209&view=rev Author: andrewross Date: 2012-08-13 21:29:59 +0000 (Mon, 13 Aug 2012) Log Message: ----------- Fix off-by-one error calculating maximum size for strncat. Fixes warning when building with hardening flags on Debian. Modified Paths: -------------- trunk/examples/c/x29c.c trunk/examples/c++/x29.cc Modified: trunk/examples/c/x29c.c =================================================================== --- trunk/examples/c/x29c.c 2012-08-13 21:25:25 UTC (rev 12208) +++ trunk/examples/c/x29c.c 2012-08-13 21:29:59 UTC (rev 12209) @@ -365,7 +365,7 @@ plbox( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); plcol0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen( title ) ); + strncat( title, title_suffix, 100 - strlen( title ) ); pllab( xtitle, "TAI-UTC (sec)", title ); plcol0( 4 ); Modified: trunk/examples/c++/x29.cc =================================================================== --- trunk/examples/c++/x29.cc 2012-08-13 21:25:25 UTC (rev 12208) +++ trunk/examples/c++/x29.cc 2012-08-13 21:29:59 UTC (rev 12209) @@ -375,7 +375,7 @@ pls->box( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); pls->col0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen( title ) ); + strncat( title, title_suffix, 100 - strlen( title ) - 1 ); pls->lab( xtitle, "TAI-UTC (sec)", title ); pls->col0( 4 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |