string utility

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@367 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-16 12:04:50 +00:00
parent 6dfb78ec7d
commit 1b98baa677
4 changed files with 53 additions and 1 deletions

17
src/string.c Normal file
View File

@@ -0,0 +1,17 @@
/* $Id$ */
#include <Mw/Milsko.h>
char* MwStringDupliacte(const char* str) {
char* r = malloc(strlen(str) + 1);
strcpy(r, str);
return r;
}
char* MwStringConcat(const char* str1, const char* str2) {
char* r = malloc(strlen(str1) + strlen(str2) + 1);
strcpy(r, str1);
strcat(r, str2);
return r;
}