示例#1
0
static char *con_strcat(char *s1, const char *s2)
{
        size_t l1, l2;

        l1 = con_strlen(s1);
        l2 = strlen(s2) + 1;
        s1 = realloc(s1, l1 + l2 + 1);
        if (s1 != NULL) {
                memcpy(s1 + l1, s2, l2);
                *(s1 + l1 + l2) = '\0'; /* Extra '\0' at the end. */
        }
        return s1;
}
示例#2
0
void ConAlias::SetCommandString(const conchar *string)
{
	ResizeBuffer<conchar *>(description, con_strlen(string) + 1);
	con_strcpy(description, string);
}