Subversion Repositories IRC-Archiver

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/* $Id: util.c 3 2024-08-29 18:49:46Z nishi $ */

#include "ia_util.h"

#include <stdlib.h>
#include <string.h>

char* ia_strcat(const char* a, const char* b) {
        char* str = malloc(strlen(a) + strlen(b) + 1);
        memcpy(str, a, strlen(a));
        memcpy(str + strlen(a), b, strlen(b));
        str[strlen(a) + strlen(b)] = 0;
        return str;
}

char* ia_strdup(const char* str) { return ia_strcat(str, ""); }