diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-10 15:23:02 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-10 15:23:02 -0700 |
commit | 3c676ecee839e6b0a1e5c5d4b3524edcb0bd2a42 (patch) | |
tree | 5bd53ba91d6986c216880153cda60495ac4eec12 /fpdfsdk/src/fsdk_baseannot.cpp | |
parent | 1e580a10fad09833552deb797128e00c50d74bce (diff) | |
download | pdfium-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/fsdk_baseannot.cpp')
-rw-r--r-- | fpdfsdk/src/fsdk_baseannot.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 8265662be3..7848740510 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -357,13 +357,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; } |