diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-11 14:25:05 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-11 14:25:05 -0700 |
commit | 2080b3e1b18126628890c61a62eca28dcd65818e (patch) | |
tree | fb4fee30fb2bbbc91d7543fec4455e4379fcc32a /xfa | |
parent | 404e7e76fa8007468bd0ef58305ccff1895dfbf7 (diff) | |
download | pdfium-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 'xfa')
-rw-r--r-- | xfa/include/fwl/core/fwl_error.h | 5 | ||||
-rw-r--r-- | xfa/src/fxgraphics/src/pre.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/xfa/include/fwl/core/fwl_error.h b/xfa/include/fwl/core/fwl_error.h index 4bd2ae4407..d790bee5ac 100644 --- a/xfa/include/fwl/core/fwl_error.h +++ b/xfa/include/fwl/core/fwl_error.h @@ -29,8 +29,9 @@ typedef FX_INT32 FWL_ERR; { \
if ((arg) != FWL_ERR_Succeeded) \
{ \
- char buf[16]; \
- sprintf(buf, "Error code is %d\n", arg); \
+ char buf[36]; \
+ memset(buf, 0, sizeof(buf)); \
+ FXSYS_snprintf(buf, sizeof(buf) - 1, "Error code is %d\n", arg); \
::OutputDebugString(buf); \
} \
}
diff --git a/xfa/src/fxgraphics/src/pre.h b/xfa/src/fxgraphics/src/pre.h index dc82b35a74..ab0df3d9ac 100644 --- a/xfa/src/fxgraphics/src/pre.h +++ b/xfa/src/fxgraphics/src/pre.h @@ -100,7 +100,8 @@ static const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = { WORD wSecond = stop.wSecond - start.wSecond; \
WORD wMilliseconds = stop.wMilliseconds - start.wMilliseconds; \
char buf[256]; \
- sprintf(buf, "duration is %d millisecond\n", wSecond * 1000 + wMilliseconds); \
+ memset(buf, 0, sizeof(buf)); \
+ snprintf(buf, sizeof(buf) - 1, "duration is %d millisecond\n", wSecond * 1000 + wMilliseconds); \
::OutputDebugString(buf);
#elif defined (__linux) || defined (linux)
#define FX_START_TIMER
|