Немного строковых функций C

split

int split(const char *input, const char *split, char *left, char *right) {
    char *pos = strstr(input, split);
    if (pos == NULL) {
        strcpy(left, input);
        right[0] = '\0';
        return -1;
    }
    strncpy(left, input, pos - input);
    left[pos - input] = '\0';
    strcpy(right, pos + strlen(split));
    return pos-input;
}