Skip to content

Commit

Permalink
Actual implementation of stringcat would be handy
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Mar 6, 2014
1 parent 5e44ee9 commit 184ca4d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/general/string.c
Expand Up @@ -102,14 +102,19 @@ t_string *string_strdup(t_string *s) {


t_string *string_strcat0(t_string *dst, const char *src) {
t_string *str = string_new();
return str;
t_string *s = char0_to_string(src);
return string_strcat(dst, s);
}


t_string *string_strcat(t_string *dst, const t_string *src) {
t_string *str = string_new();
return str;
dst->val = (char *)smm_realloc(dst->val, dst->len + src->len);
memcpy(dst->val + dst->len, src->val, src->len);
dst->val[dst->len + src->len] = '\0';
dst->len += src->len;

return dst;

}


Expand Down

0 comments on commit 184ca4d

Please sign in to comment.