Return ENAMETOOLONG if the latest copied character

is not null terminator.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Ruslan Bukin 2018-08-03 16:44:56 +00:00
parent c16bd872dc
commit c50c8f642c

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
* Copyright (c) 2015-2018 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* Portions of this software were developed by SRI International and the
@ -133,5 +133,8 @@ ENTRY(copyinstr)
sd a5, 0(a3) /* done = count */
4: mv a0, x0 /* return 0 */
beqz a4, 5f
li a0, ENAMETOOLONG
5:
ret
END(copyinstr)