mescc: Mes C Library: Prepare for M2-Planet: strcpy.
* lib/string/strcpy.c: Rewrite C-constructs not supported by M2-Planet.
This commit is contained in:
parent
c117abe06a
commit
8194ecfc0f
|
@ -1,6 +1,6 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* GNU Mes --- Maxwell Equations of Software
|
||||||
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
*
|
*
|
||||||
* This file is part of GNU Mes.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -24,8 +24,14 @@ char *
|
||||||
strcpy (char *dest, char const *src)
|
strcpy (char *dest, char const *src)
|
||||||
{
|
{
|
||||||
char *p = dest;
|
char *p = dest;
|
||||||
while (*src)
|
|
||||||
*p++ = *src++;
|
while (src[0] != 0)
|
||||||
*p = 0;
|
{
|
||||||
|
p[0] = src[0];
|
||||||
|
p = p + 1;
|
||||||
|
src = src + 1;
|
||||||
|
}
|
||||||
|
p[0] = 0;
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue