summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-11 14:25:05 -0700
committerTom Sepez <tsepez@chromium.org>2015-03-11 14:25:05 -0700
commit2080b3e1b18126628890c61a62eca28dcd65818e (patch)
treefb4fee30fb2bbbc91d7543fec4455e4379fcc32a /fpdfsdk/src/fpdfview.cpp
parent404e7e76fa8007468bd0ef58305ccff1895dfbf7 (diff)
downloadpdfium-2080b3e1b18126628890c61a62eca28dcd65818e.tar.xz
Merge to XFA: Kill remaining sprintfs
There is fx_codec_png.cpp that has a sprintf under XFA that was not present in master. Original Review URL: https://codereview.chromium.org/999543002 R=thestig@chromium.org Review URL: https://codereview.chromium.org/995993002
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 db191245f3..c0b39ed3b8 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -572,7 +572,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
@@ -590,7 +591,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);
@@ -626,7 +628,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);