[vlc-devel] [PATCH 3/3] freetype: Simplify path check
Francois Cartegnie
fcvlcdev at free.fr
Sun Jun 18 21:40:31 CEST 2017
Le 18/06/2017 à 21:31, Marvin Scholz a écrit :
>>> /* 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?
Misread *again*, as space " ".
Seems ok.
Francois
More information about the vlc-devel
mailing list