srcs/terminal/get_next_line_utils.c
char    *trm_strjoin_gnl(char const *s1, char const *s2)
{
    size_t  i;
    size_t  j;
    size_t  len;
    char    *str;

    len = trm_strlen_gnl(s1) + trm_strlen_gnl(s2) + 1;
    if (!(str = malloc(sizeof(*str) * len)))
        return (NULL);
    i = 0;
    j = 0;
    while (s1 != NULL && s1[i])
    {
        str[i] = s1[i];
        ++i;
    }
    free((char *)s1);
    s1 = NULL;
    while (s2[j] && s2[j] != '\n')
    {
        str[i + j] = s2[j];
        ++j;
    }
    str[i + j] = '\0';
    return (str);
}
/*
** if s1 contains \n > massive fuckup
** trm_strlen_gnl(s1) will be to small and first while
** will copy to much of s1 into str
*/
if s1 contains \n > massive fuckup
trm_strlen_gnl(s1) will be to small and first while
will copy to much of s1 into str
if s1 contains \ n > massive fuckup trm_strlen_gnl ( s1 ) will be to small and first while will copy to much of s1 into str
char    *trm_strjoin_gnl(char const *s1, char const *s2)
{
    size_t  i;
    size_t  j;
    size_t  len;
    char    *str;
    len = trm_strlen_gnl(s1) + trm_strlen_gnl(s2) + 1;
    if (!(str = malloc(sizeof(*str) * len)))
        return (NULL);
    i = 0;
    j = 0;
    while (s1 != NULL && s1[i])
    {
        str[i] = s1[i];
        ++i;
    }
    free((char *)s1);
    s1 = NULL;
    while (s2[j] && s2[j] != '\n')
    {
        str[i + j] = s2[j];
        ++j;
    }
    str[i + j] = '\0';
    return (str);
}
char * trm_strjoin_gnl ( char const * s1 , char const * s2 ) { size_t i ; size_t j ; size_t len ; char * str ; len = trm_strlen_gnl ( s1 ) + trm_strlen_gnl ( s2 ) + 1 ; if ( ! ( str = malloc ( sizeof ( * str ) * len ) ) ) return ( NULL ) ; i = 0 ; j = 0 ; while ( s1 != NULL && s1 [ i ] ) { str [ i ] = s1 [ i ] ; ++ i ; } free ( ( char * ) s1 ) ; s1 = NULL ; while ( s2 [ j ] && s2 [ j ] != ' \n ' ) { str [ i + j ] = s2 [ j ] ; ++ j ; } str [ i + j ] = ' \0 ' ; return ( str ) ; }
if s1 contains \n > massive fuckup
trm_strlen_gnl(s1) will be to small and first while
will copy to much of s1 into str
if s1 contains \ n > massive fuckup trm_strlen_gnl ( s1 ) will be to small and first while will copy to much of s1 into str