1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | herr_t
ss_string_cat(ss_string_t *str, const char *s)
{
SS_ENTER(ss_string_cat, herr_t);
if (!str) SS_ERROR_FMT(USAGE, ("no ss_string_t supplied"));
if (s && str->nbytes>0 && '\0'!=str->p[str->nbytes-1]) {
if (ss_string_splice(str, s, str->nbytes-1, strlen(s)+1, 1)<0) SS_ERROR(FAILED);
} else if (s) {
if (ss_string_splice(str, s, str->nbytes, strlen(s)+1, 0)<0) SS_ERROR(FAILED);
}
SS_CLEANUP:
SS_LEAVE(0);
}
|