summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-06 00:26:39 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-06 11:47:20 +0200
commit5a7b0d2c7f3a305eb5f4eb629c0a08a256cc9ae3 (patch)
tree99a634fa21c57516b6f40b7bb9d5218c6ebf1b8c
parent2f89245fb7e1c94bed49dde10b08ab1cf41b597b (diff)
vcl: lstrcpynW actually takes length *including* null terminator
... which is surprising, but means that these arguments are too small. Change-Id: I9c58e7fefa30d19c701df4f04043ddb474b28986
-rw-r--r--vcl/win/gdi/salfont.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 6819d2155182..4b844c365003 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1376,7 +1376,7 @@ HFONT WinSalGraphics::ImplDoSetFont( FontSelectPattern* i_pFont, float& o_rFontS
&& !bImplSalCourierScalable
&& bImplSalCourierNew
&& (ImplSalWICompareAscii( aLogFont.lfFaceName, "Courier" ) == 0) )
- lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
+ lstrcpynW( aLogFont.lfFaceName, L"Courier New", 12 );
// #i47675# limit font requests to MAXFONTHEIGHT
// TODO: share MAXFONTHEIGHT font instance
@@ -1413,7 +1413,7 @@ HFONT WinSalGraphics::ImplDoSetFont( FontSelectPattern* i_pFont, float& o_rFontS
{
// the selected font doesn't work => try a replacement
// TODO: use its font fallback instead
- lstrcpynW( aLogFont.lfFaceName, L"Courier New", 11 );
+ lstrcpynW( aLogFont.lfFaceName, L"Courier New", 12 );
aLogFont.lfPitchAndFamily = FIXED_PITCH;
HFONT hNewFont2 = CreateFontIndirectW( &aLogFont );
SelectFont( getHDC(), hNewFont2 );