summaryrefslogtreecommitdiff
path: root/usr.bin/jot
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-27 18:03:38 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-27 18:03:38 +0000
commit2fc3f2b1c35e38cea5062540da864e5c6083c4ec (patch)
tree896dd1804f62ec4576a5b845767f9eec7630c40b /usr.bin/jot
parent32cade518fa1930ef2acf6d3220fc6bf6d36f24e (diff)
Some asprintf() calls were checked < 0, rather than the precise == -1.
ok millert nicm tb, etc
Diffstat (limited to 'usr.bin/jot')
-rw-r--r--usr.bin/jot/jot.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index 99c1d6657cb..c84a8cb2851 100644
--- a/usr.bin/jot/jot.c
+++ b/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);
}
}