Merge pull request #22149 from seanm:sprintf
Replaced sprintf with safer snprintf * Straightforward replacement of sprintf with safer snprintf * Trickier replacement of sprintf with safer snprintf Some functions were changed to take another parameter: the size of the buffer, so that they can pass that size on to snprintf.
This commit is contained in:
@@ -60,7 +60,7 @@ int main( void )
|
||||
|
||||
//![create_trackbar]
|
||||
char TrackbarName[50];
|
||||
sprintf( TrackbarName, "Alpha x %d", alpha_slider_max );
|
||||
snprintf( TrackbarName, sizeof(TrackbarName), "Alpha x %d", alpha_slider_max );
|
||||
createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar );
|
||||
//![create_trackbar]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user