From 2a9d46ad206f7cb2f9d6acf0b01445851ea8b215 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 6 Aug 2019 17:46:45 +0200 Subject: cvs update --- src/usr.bin/signify/signify.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/usr.bin/signify/signify.c') diff --git a/src/usr.bin/signify/signify.c b/src/usr.bin/signify/signify.c index 89a7848..4829007 100644 --- a/src/usr.bin/signify/signify.c +++ b/src/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.131 2019/03/23 07:10:06 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.132 2019/07/03 03:24:02 deraadt Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -332,7 +332,7 @@ generate(const char *pubkeyfile, const char *seckeyfile, int rounds, explicit_bzero(xorkey, sizeof(xorkey)); nr = snprintf(commentbuf, sizeof(commentbuf), "%s secret key", comment); - if (nr == -1 || nr >= sizeof(commentbuf)) + if (nr < 0 || nr >= sizeof(commentbuf)) errx(1, "comment too long"); writekeyfile(seckeyfile, commentbuf, &enckey, sizeof(enckey), O_EXCL, 0600); @@ -341,7 +341,7 @@ generate(const char *pubkeyfile, const char *seckeyfile, int rounds, memcpy(pubkey.pkalg, PKALG, 2); memcpy(pubkey.keynum, keynum, KEYNUMLEN); nr = snprintf(commentbuf, sizeof(commentbuf), "%s public key", comment); - if (nr == -1 || nr >= sizeof(commentbuf)) + if (nr < 0 || nr >= sizeof(commentbuf)) errx(1, "comment too long"); writekeyfile(pubkeyfile, commentbuf, &pubkey, sizeof(pubkey), O_EXCL, 0666); @@ -871,7 +871,7 @@ main(int argc, char **argv) usage("must specify sigfile with - message"); nr = snprintf(sigfilebuf, sizeof(sigfilebuf), "%s.sig", msgfile); - if (nr == -1 || nr >= sizeof(sigfilebuf)) + if (nr < 0 || nr >= sizeof(sigfilebuf)) errx(1, "path too long"); sigfile = sigfilebuf; } -- cgit 1.4.1