summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpki-client
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-04-11 15:52:24 +0000
committerderaadt <deraadt@openbsd.org>2020-04-11 15:52:24 +0000
commitb55f176a069f88c9088824d76d040de3fc9ee40b (patch)
tree5c464a47cc58fb5852eef92dd1322968d37c66bf /usr.sbin/rpki-client
parentremove a __unused attribute, it's obvious and complicates things. (diff)
downloadwireguard-openbsd-b55f176a069f88c9088824d76d040de3fc9ee40b.tar.xz
wireguard-openbsd-b55f176a069f88c9088824d76d040de3fc9ee40b.zip
To help -portable, use a strrchr instead of basename, since we know what
kinds of paths are coming in here. ok benno claudio
Diffstat (limited to 'usr.sbin/rpki-client')
-rw-r--r--usr.sbin/rpki-client/tal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/rpki-client/tal.c b/usr.sbin/rpki-client/tal.c
index d66cdba9d04..53a95f9cb45 100644
--- a/usr.sbin/rpki-client/tal.c
+++ b/usr.sbin/rpki-client/tal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tal.c,v 1.17 2020/03/27 12:46:00 claudio Exp $ */
+/* $OpenBSD: tal.c,v 1.18 2020/04/11 15:52:24 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -142,7 +142,7 @@ struct tal *
tal_parse(const char *fn, char *buf)
{
struct tal *p;
- char *d;
+ const char *d;
size_t dlen;
p = tal_parse_buffer(fn, buf);
@@ -150,9 +150,11 @@ tal_parse(const char *fn, char *buf)
return NULL;
/* extract the TAL basename (without .tal suffix) */
- d = basename(fn);
+ d = strrchr(fn, '/');
if (d == NULL)
- err(1, "%s: basename", fn);
+ d = fn;
+ else
+ d++;
dlen = strlen(d);
if (strcasecmp(d + dlen - 4, ".tal") == 0)
dlen -= 4;