changeset 2261:281e2df2c022

Win: Fix logic error; only insert NULLs after searching the font string.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 27 Jan 2021 09:35:38 +0000
parents cb24daa675a2
children fe64be23680e
files win/dw.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Wed Jan 27 09:15:45 2021 +0000
+++ b/win/dw.c	Wed Jan 27 09:35:38 2021 +0000
@@ -5700,10 +5700,12 @@
             else /* Otherwise use the whole fontname and default size of 9 */
                myFontName = _strdup(fontname);
 
-            if((Italic = strstr(myFontName, " Italic")))
-              *Italic = 0;
-            if((Bold = strstr(myFontName, " Bold")))
-              *Bold = 0;
+            Italic = strstr(myFontName, " Italic");
+            Bold = strstr(myFontName, " Bold");
+            if(Italic)
+                *Italic = 0;
+            if(Bold)
+                *Bold = 0;
 
             cf.cbSize = sizeof(cf);
             SendMessage(handle, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf);