summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-10 15:23:02 -0700
committerTom Sepez <tsepez@chromium.org>2015-03-10 15:23:02 -0700
commit3c676ecee839e6b0a1e5c5d4b3524edcb0bd2a42 (patch)
tree5bd53ba91d6986c216880153cda60495ac4eec12 /fpdfsdk/src/fpdfview.cpp
parent1e580a10fad09833552deb797128e00c50d74bce (diff)
downloadpdfium-3c676ecee839e6b0a1e5c5d4b3524edcb0bd2a42.tar.xz
Kill remaining sprintfs
I thought I had done this already, apart from the third-party libraries, but there were a couple remaining (the third-party libraries will still call this, they should be tweaked upstream as needed). R=thestig@chromium.org Review URL: https://codereview.chromium.org/999543002
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 401f817be2..09690d3345 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -411,7 +411,8 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
#ifdef DEBUG_TRACE
{
char str[128];
- sprintf(str, "Rendering DIB %d x %d", width, height);
+ memset(str, 0, sizeof(str));
+ FXSYS_snprintf(str, sizeof(str) - 1, "Rendering DIB %d x %d", width, height);
CPDF_ModuleMgr::Get()->ReportError(999, str);
}
#endif
@@ -429,7 +430,8 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
if (pContext->m_hBitmap == NULL) {
#if defined(DEBUG) || defined(_DEBUG)
char str[128];
- sprintf(str, "Error CreateDIBSection: %d x %d, error code = %d", width, height, GetLastError());
+ memset(str, 0, sizeof(str));
+ FXSYS_snprintf(str, sizeof(str) - 1, "Error CreateDIBSection: %d x %d, error code = %d", width, height, GetLastError());
CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
#else
CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);
@@ -465,7 +467,8 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
if (hMemDC == NULL) {
#if defined(DEBUG) || defined(_DEBUG)
char str[128];
- sprintf(str, "Error CreateCompatibleDC. Error code = %d", GetLastError());
+ memset(str, 0, sizeof(str));
+ FXSYS_snprintf(str, sizeof(str) - 1, "Error CreateCompatibleDC. Error code = %d", GetLastError());
CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
#else
CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);