Subversion Repositories IRC-Archiver

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 nishi 1
/* $Id: util.c 3 2024-08-29 18:49:46Z nishi $ */
2
 
3
#include "ia_util.h"
4
 
5
#include <stdlib.h>
6
#include <string.h>
7
 
8
char* ia_strcat(const char* a, const char* b) {
9
	char* str = malloc(strlen(a) + strlen(b) + 1);
10
	memcpy(str, a, strlen(a));
11
	memcpy(str + strlen(a), b, strlen(b));
12
	str[strlen(a) + strlen(b)] = 0;
13
	return str;
14
}
15
 
16
char* ia_strdup(const char* str) { return ia_strcat(str, ""); }