diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-30 16:07:58 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-05-30 16:07:58 +0000 |
commit | 520557c0b24a34faf768fb1af88d9917111b7b49 (patch) | |
tree | 93bd9ea01ea162b9e957621f9059459af2672754 /usr.bin | |
parent | ff67f4b9f18aba835885120ec40407ae8a13c286 (diff) |
fix segfault when using just-one-space on an empty line; from
dkm_holdings@hotmail.com
ok art@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/random.c | 6 |
1 files changed, 3 insertions, 3 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) { |