mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #23055 from seanm:sprintf2
* Replaced most remaining sprintf with snprintf * Deprecated encodeFormat and introduced new method that takes the buffer length * Also increased buffer size at call sites to be a little bigger, in case int is 64 bit
This commit is contained in:
@@ -497,7 +497,7 @@ static string idx2string(const int* idx, int dims)
|
||||
char* ptr = buf;
|
||||
for( int k = 0; k < dims; k++ )
|
||||
{
|
||||
sprintf(ptr, "%4d ", idx[k]);
|
||||
snprintf(ptr, sizeof(buf) - (ptr - buf), "%4d ", idx[k]);
|
||||
ptr += strlen(ptr);
|
||||
}
|
||||
ptr[-1] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user