[vlc-devel] [PATCH 3/3] freetype: Simplify path check
Marvin Scholz
epirat07 at gmail.com
Sun Jun 18 21:31:52 CEST 2017
On 18 Jun 2017, at 13:29, Francois Cartegnie wrote:
> Le 17/06/2017 à 17:08, Marvin Scholz a écrit :
>> ---
>> modules/text_renderer/freetype/fonts/darwin.c | 8 ++------
>> 1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/modules/text_renderer/freetype/fonts/darwin.c
>> b/modules/text_renderer/freetype/fonts/darwin.c
>> index 06dec792da..a3ea832954 100644
>> --- a/modules/text_renderer/freetype/fonts/darwin.c
>> +++ b/modules/text_renderer/freetype/fonts/darwin.c
>> @@ -172,12 +172,8 @@ const vlc_family_t *CoreText_GetFamily(filter_t
>> *p_filter, const char *psz_famil
>> path = getPathForFontDescription(iter);
>>
>> /* check if the path is empty, which can happen in rare
>> circumstances */
>> - if (path != NULL) {
>> - if (strcmp("", path) == 0) {
>> - FREENULL(path);
>> - continue;
>> - }
>> - } else {
>> + if (path == NULL || *path == '\0') {
>> + FREENULL(path);
>> continue;
>> }
>
> No simplification as it is not checking the same thing
Thanks for having a look,
can you please explain why this is not checking for the same thing, I
fail to see it.
Isn't both `strcmp("", path) == 0` and `*path == '\0'` checking if the
path is empty?
>
> Francois
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list