# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1611740138 0 # Node ID 281e2df2c0228c26c8f9f9dd26c483650bca096d # Parent cb24daa675a2cc5f2d8c9ade8475061acf92ab20 Win: Fix logic error; only insert NULLs after searching the font string. diff -r cb24daa675a2 -r 281e2df2c022 win/dw.c --- 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);