Skip to content

Commit

Permalink
views: remove null check
Browse files Browse the repository at this point in the history
- With newer compiler/libraries, getting error
```
VwTxtSrc.cpp(1864,38): error GB35ED869: the address of
‘__MIDL___MIDL_itf_FwKernelTlb_0001_0086_0001::szFaceName’ will
never be NULL [-Werror=address]
1864 |         if (pchrpOverride.szFaceName != NULL &&
wcslen(pchrpOverride.szFaceName) != 0)
        |                                      ^
  In file included from Main.h:95,
                   from VwTxtSrc.cpp:18:
FwKernelTlb.h:740:13: note:
‘__MIDL___MIDL_itf_FwKernelTlb_0001_0086_0001::szFaceName’
declared here
    740 |     OLECHAR szFaceName[ 32 ];
        |             ^~~~~~~~~~
```
  and the same for `szFontVar`.

Change-Id: I6488eb44eef76eeddcd4f6cbd0e6c40c94fb4a70
  • Loading branch information
marksvc committed Jan 3, 2023
1 parent a95f116 commit 54e4da9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/views/VwTxtSrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,9 @@ void VwOverrideTxtSrc::Merge(LgCharRenderProps * pchrpOrig, LgCharRenderProps &
pchrpOrig->ttvItalic = pchrpOverride.ttvItalic;
if (pchrpOverride.dympHeight > -1)
pchrpOrig->dympHeight = pchrpOverride.dympHeight;
if (pchrpOverride.szFaceName != NULL && wcslen(pchrpOverride.szFaceName) != 0)
if (wcslen(pchrpOverride.szFaceName) != 0)
wcscpy_s(pchrpOrig->szFaceName, LF_FACESIZE, pchrpOverride.szFaceName);
if (pchrpOverride.szFontVar != NULL && wcslen(pchrpOverride.szFontVar) != 0)
if (wcslen(pchrpOverride.szFontVar) != 0)
wcscpy_s(pchrpOrig->szFontVar, 64, pchrpOverride.szFontVar);
}

Expand Down

0 comments on commit 54e4da9

Please sign in to comment.