aboutsummaryrefslogtreecommitdiff
path: root/bin/ed/buf.c
diff options
context:
space:
mode:
authorAndrew Moore <alm@FreeBSD.org>1993-06-26 06:47:21 +0000
committerAndrew Moore <alm@FreeBSD.org>1993-06-26 06:47:21 +0000
commit10ca1c6c925d4ce2f2e0a38c45e05b39daeab2be (patch)
treea75d2f4512b2836bcc2e21f718151792e640b67f /bin/ed/buf.c
parent3340e10399b66a98798381d5f8d00468b4b8f18e (diff)
downloadsrc-10ca1c6c925d4ce2f2e0a38c45e05b39daeab2be.tar.gz
src-10ca1c6c925d4ce2f2e0a38c45e05b39daeab2be.zip
Notes
Diffstat (limited to 'bin/ed/buf.c')
-rw-r--r--bin/ed/buf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index 57c336121ca1..1d74cb827f4a 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -165,7 +165,11 @@ getaddr(lp)
while (cp != lp && (cp = cp->next) != &line0)
n++;
- return (cp != &line0) ? n : 0;
+ if (n && cp == &line0) {
+ sprintf(errmsg, "invalid address");
+ return ERR;
+ }
+ return n;
}