1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

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:
Sean McBride
2022-06-24 23:48:22 -04:00
committed by GitHub
parent a6ca48a1c2
commit 35f1a90df7
34 changed files with 126 additions and 131 deletions
+1 -1
View File
@@ -520,7 +520,7 @@ cvPreprocessCategoricalResponses( const CvMat* responses,
if( ri != rf )
{
char buf[100];
sprintf( buf, "response #%d is not integral", idx );
snprintf( buf, sizeof(buf), "response #%d is not integral", idx );
CV_ERROR( CV_StsBadArg, buf );
}
dst[i] = ri;