Subversion Repositories Tewi

Rev

Rev 2 | Rev 4 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 3
Line 1... Line 1...
1
/* $Id: string.c 2 2024-09-13 08:38:39Z nishi $ */
1
/* $Id: string.c 3 2024-09-13 09:06:44Z nishi $ */
-
 
2
 
-
 
3
#include <string.h>
-
 
4
#include <stdlib.h>
-
 
5
 
-
 
6
char* cm_strcat(const char* a, const char* b) {
-
 
7
	char* str = malloc(strlen(a) + strlen(b) + 1);
-
 
8
	memcpy(str, a, strlen(a));
-
 
9
	memcpy(str + strlen(a), b, strlen(b));
-
 
10
	str[strlen(a) + strlen(b)] = 0;
-
 
11
	return str;
-
 
12
}
-
 
13
 
-
 
14
char* cm_strdup(const char* str) { return cm_strcat(str, ""); }