summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mg/def.h4
-rw-r--r--usr.bin/mg/region.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h
index 7866eea3f3f..993eec69a01 100644
--- a/usr.bin/mg/def.h
+++ b/usr.bin/mg/def.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: def.h,v 1.78 2005/11/22 05:02:44 kjell Exp $ */
+/* $OpenBSD: def.h,v 1.79 2005/12/13 05:23:03 kjell Exp $ */
/* This file is in the public domain. */
@@ -524,7 +524,7 @@ int upperregion(int, int);
int prefixregion(int, int);
int setprefix(int, int);
int region_get_data(struct region *, char *, int);
-int region_put_data(const char *, int);
+void region_put_data(const char *, int);
/* search.c X */
int forwsearch(int, int);
diff --git a/usr.bin/mg/region.c b/usr.bin/mg/region.c
index dc0c0c50b60..7df2c891db0 100644
--- a/usr.bin/mg/region.c
+++ b/usr.bin/mg/region.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: region.c,v 1.19 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: region.c,v 1.20 2005/12/13 05:23:03 kjell Exp $ */
/* This file is in the public domain. */
@@ -348,16 +348,15 @@ region_get_data(struct region *reg, char *buf, int len)
return (i);
}
-int
+void
region_put_data(const char *buf, int len)
{
int i;
- for (i = 0; buf[i]; i++) {
+ for (i = 0; buf[i] != NULL && i < len; i++) {
if (buf[i] == '\n')
lnewline();
else
linsert(1, buf[i]);
}
- return (0);
}