]> git.ipfire.org Git - location/libloc.git/commit
countries: Fix matching invalid country codes
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 09:37:22 +0000 (09:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 10:08:49 +0000 (10:08 +0000)
commite73b7709ea09ebe108ea3427e27ce52eafa97093
tree24eb51f91d4192f14e96059431aea49a104b263f
parentdcef2ba4773bf1692849823dccf0121dba23cb4e
countries: Fix matching invalid country codes

When an invalid country code is entered, loc_country_new returns an
error which is interpreted as a match to the list since we check for a
non-zero return code.

Any invalid country codes are now silently ignored and not considered a
match.

Fixes: #12620 - "location list-networks-by-cc" returns garbage
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/country-list.c
src/country.c