fstab-util: detect out-of-range pri= assignments

We would silently ignore them. One would have to be crazy
to do assign an out of range value, but simply ignoring it
bothers me.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-01-10 22:59:44 -05:00
parent 266fd0eabc
commit c5e04d5127

View file

@ -140,6 +140,9 @@ int fstab_find_pri(const char *options, int *ret) {
if (r < 0)
return r;
if ((int) pri < 0)
return -ERANGE;
*ret = (int) r;
return 1;
}