Sign in
plan9port
/
plan9
/
3f6a501b4d661acb8dba53d8a857e963aad2fe6b
/
.
/
src
/
lib9
/
strecpy.c
blob: 7d2f2277c3d69c104d121e00ea942015556a4e23 [
file
] [
log
] [
blame
]
rsc
b2cfc4e
2003-09-30 17:47:41 +0000
[
diff
] [
blame
]
1
#include
<lib9.h>
2
3
char
*
4
strecpy
(
char
*
to
,
char
*
e
,
char
*
from
)
5
{
6
if
(
to
>=
e
)
7
return
to
;
8
to
=
memccpy
(
to
,
from
,
'\0'
,
e
-
to
);
9
if
(
to
==
nil
){
10
to
=
e
-
1
;
11
*
to
=
'\0'
;
12
}
else
{
13
to
--;
14
}
15
return
to
;
16
}