diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2009-06-02 21:55:26 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2009-06-02 21:55:26 +0000 |
commit | 471fbc1af6e634eba6dfa609568aea0893793bc1 (patch) | |
tree | 19f97608213a176eb2609896b1cbb18b7f521af6 /usr.bin | |
parent | c51545ca9a7e9c95c79b6347018c0f05489d523e (diff) |
we were erroneously setting fill-column, even when the input
to set-fill-column was garbage. (common, since they keystroke is
so close to find-file). Fix!
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/paragraph.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mg/paragraph.c b/usr.bin/mg/paragraph.c index 0ef46bd38d5..1e44df42538 100644 --- a/usr.bin/mg/paragraph.c +++ b/usr.bin/mg/paragraph.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paragraph.c,v 1.17 2008/09/15 16:13:35 kjell Exp $ */ +/* $OpenBSD: paragraph.c,v 1.18 2009/06/02 21:55:25 kjell Exp $ */ /* This file is in the public domain. */ @@ -336,6 +336,7 @@ setfillcol(int f, int n) { char buf[32], *rep; const char *es; + int nfill; if ((f & FFARG) != 0) { fillcol = n; @@ -345,9 +346,12 @@ setfillcol(int f, int n) return (ABORT); else if (rep[0] == '\0') return (FALSE); - fillcol = strtonum(rep, 0, INT_MAX, &es); - if (es != NULL) + nfill = strtonum(rep, 0, INT_MAX, &es); + if (es != NULL) { + ewprintf("Invalid fill column: %s", rep); return (FALSE); + } + fillcol = nfill; ewprintf("Fill column set to %d", fillcol); } return (TRUE); |