diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2016-09-27 02:02:48 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2016-09-27 02:02:48 +0000 |
commit | 048bdf675b278c3add18659bb7501c9dd7e67d48 (patch) | |
tree | e49b7a9075d6b79206618e27f2df06d68b7fbab1 | |
parent | b661603c48a7b16f20a05e49baae910b352b3a0e (diff) |
no need to copy keypath if we already have one
-rw-r--r-- | usr.bin/signify/signify.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index e8289bc2f43..df96efb92ae 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.120 2016/09/26 21:47:54 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.121 2016/09/27 02:02:47 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * @@ -488,14 +488,11 @@ readpubkey(const char *pubkeyfile, struct pubkey *pubkey, if (snprintf(keypath, sizeof(keypath), "%s/%s", safepath, pubkeyfile) >= sizeof(keypath)) errx(1, "name too long %s", pubkeyfile); + pubkeyfile = keypath; } else usage("must specify pubkey"); - } else { - if (strlcpy(keypath, pubkeyfile, sizeof(keypath)) >= - sizeof(keypath)) - errx(1, "name too long %s", pubkeyfile); } - readb64file(keypath, pubkey, sizeof(*pubkey), NULL); + readb64file(pubkeyfile, pubkey, sizeof(*pubkey), NULL); } static void |