summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincent <vincent@openbsd.org>2002-05-30 16:07:57 +0000
committervincent <vincent@openbsd.org>2002-05-30 16:07:57 +0000
commit0631d3ab6eb63f9ca891cf3edace432f980d27e8 (patch)
tree9422e61c376aae00cbecaa017dda42ac0bf8bfba
parentpower management and microwave over robustness are booleans (diff)
downloadwireguard-openbsd-0631d3ab6eb63f9ca891cf3edace432f980d27e8.tar.xz
wireguard-openbsd-0631d3ab6eb63f9ca891cf3edace432f980d27e8.zip
fix segfault when using just-one-space on an empty line; from
dkm_holdings@hotmail.com ok art@
-rw-r--r--usr.bin/mg/random.c6
-rw-r--r--usr.bin/mg/util.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mg/random.c b/usr.bin/mg/random.c
index bd652c4d66a..4f44e9cd8fe 100644
--- a/usr.bin/mg/random.c
+++ b/usr.bin/mg/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.7 2002/02/14 14:24:21 deraadt Exp $ */
+/* $OpenBSD: random.c,v 1.8 2002/05/30 16:07:57 vincent Exp $ */
/*
* Assorted commands.
@@ -246,8 +246,8 @@ delwhite(f, n)
col = curwp->w_doto;
- while (((c = lgetc(curwp->w_dotp, col)) == ' ' || c == '\t') &&
- col < llength(curwp->w_dotp))
+ while (col < llength(curwp->w_dotp) &&
+ ((c = lgetc(curwp->w_dotp, col)) == ' ' || c == '\t'))
++col;
do {
if (curwp->w_doto == 0) {
diff --git a/usr.bin/mg/util.c b/usr.bin/mg/util.c
index 7fbc0458b0e..c4f5fdfdc03 100644
--- a/usr.bin/mg/util.c
+++ b/usr.bin/mg/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.7 2002/02/14 14:24:21 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.8 2002/05/30 16:07:57 vincent Exp $ */
/*
* Assorted commands.
@@ -246,8 +246,8 @@ delwhite(f, n)
col = curwp->w_doto;
- while (((c = lgetc(curwp->w_dotp, col)) == ' ' || c == '\t') &&
- col < llength(curwp->w_dotp))
+ while (col < llength(curwp->w_dotp) &&
+ ((c = lgetc(curwp->w_dotp, col)) == ' ' || c == '\t'))
++col;
do {
if (curwp->w_doto == 0) {