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/calendar/io.c | 6 +++--- src/usr.bin/jot/jot.c | 10 +++++----- src/usr.bin/lndir/lndir.c | 22 +++++++++++----------- src/usr.bin/signify/signify.c | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/usr.bin/calendar/io.c b/src/usr.bin/calendar/io.c index 3a58850..d062568 100644 --- a/src/usr.bin/calendar/io.c +++ b/src/usr.bin/calendar/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.48 2019/01/29 22:28:30 tedu Exp $ */ +/* $OpenBSD: io.c,v 1.49 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -331,7 +331,7 @@ opencal(void) } } - if (pipe(pdes) < 0) { + if (pipe(pdes) == -1) { close(fdin); return (NULL); } @@ -393,7 +393,7 @@ closecal(FILE *fp) (void)rewind(fp); if (fstat(fileno(fp), &sbuf) || !sbuf.st_size) goto done; - if (pipe(pdes) < 0) + if (pipe(pdes) == -1) goto done; switch ((pid = vfork())) { case -1: /* error */ diff --git a/src/usr.bin/jot/jot.c b/src/usr.bin/jot/jot.c index 99c1d66..c84a8cb 100644 --- a/src/usr.bin/jot/jot.c +++ b/src/usr.bin/jot/jot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jot.c,v 1.48 2018/08/01 13:35:33 tb Exp $ */ +/* $OpenBSD: jot.c,v 1.49 2019/06/27 18:03:36 deraadt Exp $ */ /* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */ /*- @@ -357,14 +357,14 @@ getformat(void) p += 2; if (p == NULL && !chardata) { - if (asprintf(&format, "%s%%.%df", format, prec) < 0) + if (asprintf(&format, "%s%%.%df", format, prec) == -1) err(1, NULL); } else if (p == NULL && chardata) { - if (asprintf(&format, "%s%%c", format) < 0) + if (asprintf(&format, "%s%%c", format) == -1) err(1, NULL); } else if (p[1] == '\0') { /* cannot end in single '%' */ - if (asprintf(&format, "%s%%", format) < 0) + if (asprintf(&format, "%s%%", format) == -1) err(1, NULL); } else { /* @@ -447,7 +447,7 @@ fmt_broken: if (p[1] != '\0') errx(1, "too many conversions"); /* cannot end in single '%' */ - if (asprintf(&format, "%s%%", format) < 0) + if (asprintf(&format, "%s%%", format) == -1) err(1, NULL); } } diff --git a/src/usr.bin/lndir/lndir.c b/src/usr.bin/lndir/lndir.c index 2a0f04b..e1828db 100644 --- a/src/usr.bin/lndir/lndir.c +++ b/src/usr.bin/lndir/lndir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lndir.c,v 1.22 2015/10/10 14:23:12 deraadt Exp $ */ +/* $OpenBSD: lndir.c,v 1.23 2019/06/28 13:35:01 deraadt Exp $ */ /* $XConsortium: lndir.c /main/15 1995/08/30 10:56:18 gildea $ */ /* @@ -118,15 +118,15 @@ main(int argc, char *argv[]) tn = "."; /* to directory */ - if (stat(tn, &ts) < 0) + if (stat(tn, &ts) == -1) err(1, "%s", tn); if (!(S_ISDIR(ts.st_mode))) errc(2, ENOTDIR, "%s", tn); - if (chdir(tn) < 0) + if (chdir(tn) == -1) err(1, "%s", tn); /* from directory */ - if (stat(fn, &fs) < 0) + if (stat(fn, &fs) == -1) err(1, "%s", fn); if (!(S_ISDIR(fs.st_mode))) errc(2, ENOTDIR, "%s", fn); @@ -221,7 +221,7 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel) strlcpy(p, dp->d_name, buf + sizeof(buf) - p); if (n_dirs > 0) { - if (stat(buf, &sb) < 0) { + if (stat(buf, &sb) == -1) { warn("%s", buf); continue; } @@ -247,10 +247,10 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel) curdir = silent ? buf : NULL; if (!silent) printf("%s:\n", buf); - if (stat(dp->d_name, &sc) < 0 && + if (stat(dp->d_name, &sc) == -1 && errno == ENOENT) { - if (mkdir(dp->d_name, 0777) < 0 || - stat(dp->d_name, &sc) < 0) { + if (mkdir(dp->d_name, 0777) == -1 || + stat(dp->d_name, &sc) == -1) { warn("%s", dp->d_name); curdir = rcurdir = ocurdir; continue; @@ -265,13 +265,13 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel) curdir = rcurdir = ocurdir; continue; } - if (chdir(dp->d_name) < 0) { + if (chdir(dp->d_name) == -1) { warn("%s", dp->d_name); curdir = rcurdir = ocurdir; continue; } dodir(buf, &sb, &sc, (buf[0] != '/')); - if (chdir("..") < 0) + if (chdir("..") == -1) err(1, ".."); curdir = rcurdir = ocurdir; continue; @@ -306,7 +306,7 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel) fprintf(stderr,"%s: %s\n", dp->d_name, symbuf); } else { if (symlink(basesymlen >= 0 ? basesym : buf, - dp->d_name) < 0) + dp->d_name) == -1) warn("%s", dp->d_name); } next: 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