From 048bdf675b278c3add18659bb7501c9dd7e67d48 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 27 Sep 2016 02:02:48 +0000 Subject: no need to copy keypath if we already have one --- usr.bin/signify/signify.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'usr.bin/signify') 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 * @@ -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 -- cgit v1.2.3