aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-01-21 15:01:46 +1100
committerNeil <nyamatongwe@gmail.com>2014-01-21 15:01:46 +1100
commit26a080b5ada55fd8453ee6a497c5a2c37a6ce41c (patch)
treeacc94b2f0e01e23ee2ff1f19d98db304621a58b2 /win32
parent5af7d68fe759e093e73f6bbff2125d7707ae1d1b (diff)
downloadscintilla-mirror-26a080b5ada55fd8453ee6a497c5a2c37a6ce41c.tar.gz
Avoid memset for safety.
Diffstat (limited to 'win32')
-rw-r--r--win32/PlatWin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 548d620d3..ead2d679b 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -272,7 +272,7 @@ static D2D1_TEXT_ANTIALIAS_MODE DWriteMapFontQuality(int extraFontFlag) {
#endif
static void SetLogFont(LOGFONTA &lf, const char *faceName, int characterSet, float size, int weight, bool italic, int extraFontFlag) {
- memset(&lf, 0, sizeof(lf));
+ lf = LOGFONTA();
// The negative is to allow for leading
lf.lfHeight = -(abs(static_cast<int>(size + 0.5)));
lf.lfWeight = weight;
@@ -1013,7 +1013,7 @@ void SurfaceGDI::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *
}
} else if (IsNT() || (codePage==0) || win9xACPSame) {
// Zero positions to avoid random behaviour on failure.
- memset(positions, 0, len * sizeof(*positions));
+ std::fill(positions, positions + len, 0.0f);
// len may be larger than platform supports so loop over segments small enough for platform
int startOffset = 0;
while (len > 0) {