From: "Érico Nogueira" <ericonr@disroot.org>
To: musl@lists.openwall.com
Cc: "Érico Nogueira" <ericonr@disroot.org>
Subject: [musl] [PATCH] make exit condition clearer in fixup_rpath
Date: Mon, 15 Aug 2022 15:14:25 -0300 [thread overview]
Message-ID: <20220815181425.9244-1-ericonr@disroot.org> (raw)
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index cc677952..fb77b092 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -868,7 +868,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;
}
--
2.37.2
next reply other threads:[~2022-08-15 18:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 18:14 Érico Nogueira [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-15 18:07 Érico Nogueira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220815181425.9244-1-ericonr@disroot.org \
--to=ericonr@disroot.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).