1
0
mirror of https://github.com/cc65/cc65.git synced 2025-03-04 00:30:35 +00:00

Add stpcpy().

Like strcpy() but returning pointer to ending zero of copied string.
This commit is contained in:
Sven Michael Klose 2024-07-07 14:04:49 +02:00
parent 0541b65aa4
commit 581b79e0b9
2 changed files with 9 additions and 0 deletions

View File

@ -52,6 +52,7 @@ char* __fastcall__ strchr (const char* s, int c);
int __fastcall__ strcmp (const char* s1, const char* s2);
int __fastcall__ strcoll (const char* s1, const char* s2);
char* __fastcall__ strcpy (char* dest, const char* src);
char* __fastcall__ stpcpy (char* dest, const char* src);
size_t __fastcall__ strcspn (const char* s1, const char* s2);
char* __fastcall__ strerror (int errcode);
size_t __fastcall__ strlen (const char* s);

8
libsrc/common/stpcpy.c Normal file
View File

@ -0,0 +1,8 @@
#include <string.h>
char * __fastcall__
stpcpy (char * dst, const char * src)
{
strcpy (dst, src);
return dst + strlen (src);
}