ldso: make exit condition clearer in fixup_rpath
authorÉrico Nogueira <ericonr@disroot.org>
Mon, 15 Aug 2022 18:14:25 +0000 (15:14 -0300)
committerRich Felker <dalias@aerifal.cx>
Wed, 17 Aug 2022 23:49:54 +0000 (19:49 -0400)
breaking out of the switch-case when l==-1 means the conditional below
will necessarily be true (-1 >= buf_size, a size_t variable) and the
function will return 0. it is, however, somewhat unclear that that's
what's happening. simply returning there is simpler

ldso/dynlink.c

index fd09ca6..03f5fd5 100644 (file)
@@ -886,7 +886,7 @@ static int fixup_rpath(struct dso *p, char *buf, size_t buf_size)
                case ENOENT:
                case ENOTDIR:
                case EACCES:
-                       break;
+                       return 0;
                default:
                        return -1;
                }