mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +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:
@@ -1385,7 +1385,7 @@ CV_IMPL const char* cvErrorStr( int status )
|
||||
case CV_OpenGlApiCallError : return "OpenGL API call";
|
||||
};
|
||||
|
||||
sprintf(buf, "Unknown %s code %d", status >= 0 ? "status":"error", status);
|
||||
snprintf(buf, sizeof(buf), "Unknown %s code %d", status >= 0 ? "status":"error", status);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user