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:
Jan (janneke) Nieuwenhuizen 2020-05-17 19:29:57 +02:00
parent c117abe06a
commit 8194ecfc0f
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* 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.
*
@ -24,8 +24,14 @@ char *
strcpy (char *dest, char const *src)
{
char *p = dest;
while (*src)
*p++ = *src++;
*p = 0;
while (src[0] != 0)
{
p[0] = src[0];
p = p + 1;
src = src + 1;
}
p[0] = 0;
return dest;
}