summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/m68k/m68k/copy.s9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/m68k/m68k/copy.s b/sys/arch/m68k/m68k/copy.s
index 6f1aef094dc..ca33c7d49d7 100644
--- a/sys/arch/m68k/m68k/copy.s
+++ b/sys/arch/m68k/m68k/copy.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: copy.s,v 1.11 2001/06/27 04:39:05 art Exp $ */
+/* $OpenBSD: copy.s,v 1.12 2002/01/21 19:48:54 miod Exp $ */
/* $NetBSD: copy.s,v 1.30 1998/03/04 06:39:14 thorpej Exp $ */
/*-
@@ -261,6 +261,9 @@ Lcisloop:
bcc Lcisloop | more room, keep going
Lcistoolong:
moveq #ENAMETOOLONG,d0 | ran out of space
+Lcisnull:
+ subql #1, a1
+ clrb a1@+ | clear last byte
Lcisdone:
tstl sp@(16) | length desired?
beq Lcisexit
@@ -273,7 +276,9 @@ Lcisexit:
rts
Lcisfault:
moveq #EFAULT,d0
- bra Lcisdone
+ cmpl sp@(8),a1 | do not attempt to clear last byte
+ beq Lcisdone | if we faulted on first write
+ bra Lcisnull
/*
* copyoutstr(caddr_t from, caddr_t to, size_t maxlen, size_t *lencopied);