From: Carlo Bramini Subject: [PATCH] comdlg32: Use SetDlgItemInt() instead of writing number manually. Message-Id: <991559656.11212531456053360257.JavaMail.httpd@webmail-48.iol.local> Date: Sun, 21 Feb 2016 12:16:00 +0100 (CET) A manual print of a number and the SetDlgItemTextW could be avoided, because the task could be handled entirely by SetDlgItemInt(). Attached patch fixes it. Sincerely, Carlo Bramini. diff --git a/dlls/comdlg32/fontdlg.c b/dlls/comdlg32/fontdlg.c index 344a356..2346d23 100644 --- a/dlls/comdlg32/fontdlg.c +++ b/dlls/comdlg32/fontdlg.c @@ -534,7 +534,6 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW * static void CFn_FitFontSize( HWND hDlg, int points) { - WCHAR buffW[16]; int i,n; /* look for fitting font size in combobox3 */ @@ -553,8 +552,7 @@ static void CFn_FitFontSize( HWND hDlg, int points) } /* no default matching size, set text manually */ - sprintfW(buffW, fontsizefmtW, points); - SetDlgItemTextW(hDlg, cmb3, buffW); + SetDlgItemInt(hDlg, cmb3, points, TRUE); } static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )