summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-06 00:26:39 +0200
committerMichael Meeks <michael.meeks@collabora.com>2016-05-16 14:52:52 +0000
commitcdb0d792d15da3f090b8d1db15bac1cec1a84bec (patch)
tree74477910d5ef622f5cd19e22a3bf30281a731886 /vcl
parent081b0f19b4f665a30e2209e805aebd2f25345d70 (diff)
vcl: lstrcpynW actually takes length *including* null terminator
... which is surprising, but means that these arguments are too small. (cherry picked from commit 5a7b0d2c7f3a305eb5f4eb629c0a08a256cc9ae3) Change-Id: I9c58e7fefa30d19c701df4f04043ddb474b28986 Reviewed-on: https://gerrit.libreoffice.org/24947 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 964f25fb25a1..f755f73946b3 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1466,7 +1466,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
@@ -1503,7 +1503,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 );