parse-util: in parse_permille() check negative earlier
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Jul 2018 16:50:25 +0000 (18:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 25 Jul 2018 14:14:45 +0000 (16:14 +0200)
commit8cbc92d5975b603002c3141364a7709a9c66e23a
tree9feb74f8ed02c860e40d223f504ce321d3e66558
parentd68c0833eac6d46a3ed83f0ba7a049fe24291226
parse-util: in parse_permille() check negative earlier

If 'v' is negative, it's wrong to add the decimal to it, as we'd
actually need to subtract it in this case. But given that we don't want
to allow negative vaues anyway, simply check earlier whether what we
have parsed so far was negative, and react to that before adding the
decimal to it.
src/basic/parse-util.c