X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Ffstab-util.c;h=cf317e17bda65759c5ff7ac8fe59181dec85625d;hp=a886f6a5dadd0e3a8a0665e81c3c4289fec750e2;hb=76917807eb50ccde58901e8bec7ed3d408d1cc22;hpb=c5e04d51277994cca29234b33a6b8fc90a183cf3 diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index a886f6a5d..cf317e17b 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -133,8 +133,10 @@ int fstab_find_pri(const char *options, int *ret) { assert(ret); r = fstab_filter_options(options, "pri\0", NULL, &opt, NULL); - if (r <= 0) + if (r < 0) return r; + if (r == 0 || !opt) + return 0; r = safe_atou(opt, &pri); if (r < 0) @@ -143,6 +145,6 @@ int fstab_find_pri(const char *options, int *ret) { if ((int) pri < 0) return -ERANGE; - *ret = (int) r; + *ret = (int) pri; return 1; }