summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_baseannot.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/fsdk_baseannot.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/fsdk_baseannot.cpp')
-rw-r--r--fpdfsdk/src/fsdk_baseannot.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index e57eb674cc..e80d3b8e73 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -358,13 +358,16 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString()
{
CFX_ByteString dtStr;
char tempStr[32];
- sprintf(tempStr, "D:%04d%02d%02d%02d%02d%02d", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
+ memset(tempStr, 0, sizeof(tempStr));
+ FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "D:%04d%02d%02d%02d%02d%02d",
+ dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
dtStr = CFX_ByteString(tempStr);
if (dt.tzHour < 0)
dtStr += CFX_ByteString("-");
else
dtStr += CFX_ByteString("+");
- sprintf(tempStr, "%02d'%02d'", abs(dt.tzHour), dt.tzMinute);
+ memset(tempStr, 0, sizeof(tempStr));
+ FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "%02d'%02d'", abs(dt.tzHour), dt.tzMinute);
dtStr += CFX_ByteString(tempStr);
return dtStr;
}