summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_basic_wstring.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-10 14:43:15 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-10 14:43:15 -0700
commitd794018606dfdb62f87adf065c5ba48a4607d92b (patch)
tree00072b3481bd08aab6d20b749151e2e8efb68daa /core/src/fxcrt/fx_basic_wstring.cpp
parent1569728e9f5a60b033e530ee1d4cd99e467649da (diff)
downloadpdfium-d794018606dfdb62f87adf065c5ba48a4607d92b.tar.xz
Better fix for snprintf non-termination on windows.
Replaces https://codereview.chromium.org/1062983002/ BUG=469244 R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1077903002
Diffstat (limited to 'core/src/fxcrt/fx_basic_wstring.cpp')
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index ce6a1cd763..dfdbef8bd6 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -976,9 +976,9 @@ void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
nItemLen = nPrecision + nWidth + 128;
} else {
double f;
- char pszTemp[256] = {0};
+ char pszTemp[256];
f = va_arg(argList, double);
- FXSYS_snprintf(pszTemp, sizeof(pszTemp) - 1, "%*.*f", nWidth, nPrecision + 6, f );
+ FXSYS_snprintf(pszTemp, sizeof(pszTemp), "%*.*f", nWidth, nPrecision + 6, f );
nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp);
}
break;