From 8d1899358435584f34eb28f2171f4201e1473842 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 14 Jan 2012 17:20:17 +0100 Subject: [PATCH] Added stpcpy(3). --- libmaxsi/c/hsrc/string.h | 2 +- libmaxsi/string.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libmaxsi/c/hsrc/string.h b/libmaxsi/c/hsrc/string.h index e6f42903..a5121939 100644 --- a/libmaxsi/c/hsrc/string.h +++ b/libmaxsi/c/hsrc/string.h @@ -37,6 +37,7 @@ void* memchr(const void*, int, size_t); int memcmp(const void*, const void*, size_t); void* memcpy(void* restrict, const void* restrict, size_t); void* memset(void*, int, size_t); +char* stpcpy(char* restrict, const char* restrict); char* strcat(char* restrict, const char* restrict); char* strchr(const char*, int); int strcmp(const char*, const char*); @@ -55,7 +56,6 @@ char* strtok_r(char* restrict, const char* restrict, char** restrict); #ifndef SORTIX_UNIMPLEMENTED void* memccpy(void* restrict, const void* restrict, int, size_t); void* memmove(void*, const void*, size_t); -char* stpcpy(char* restrict, const char* restrict); char* stpncpy(char* restrict, const char* restrict, size_t); int strcoll_l(const char*, const char*, locale_t); char* strdup(const char*); diff --git a/libmaxsi/string.cpp b/libmaxsi/string.cpp index 84f57683..8569b796 100644 --- a/libmaxsi/string.cpp +++ b/libmaxsi/string.cpp @@ -217,6 +217,13 @@ namespace Maxsi return Compare(s1, s2); } + extern "C" char* stpcpy(char* s1, const char* s2) + { + char* result = Copy(s1, s2); + result += Length(s1); + return result; + } + #if 0 char* Combine(size_t NumParameters, ...) {