42-School-Exam-Rank-03 icon indicating copy to clipboard operation
42-School-Exam-Rank-03 copied to clipboard

iteration before '\0'

Open casuis opened this issue 3 years ago • 3 comments

Hi, I think you i++ one time more line 24. *on get_next_line.c

casuis avatar Feb 08 '22 10:02 casuis

Hey, Thankyou for messaging, is this what you mean?

    }
    i++;
    i++;
    buffer[i] = '\0';
    return (buffer);

pasqualerossi avatar Feb 08 '22 15:02 pasqualerossi

Hi, I mean

if ((!buffer[i - 1] && !rd) || rd == -1) { free(buffer); return (NULL); } buffer[i] = '\0';Sorry for my english Le mar. 8 févr. 2022 à 16:32, Pasquale Emilio Rossi < @.***> a écrit :

Hey, Thankyou for messaging, is this what you mean?

}
i++;
i++;
buffer[i] = '\0';

return (buffer);

}

— Reply to this email directly, view it on GitHub https://github.com/pasqualerossi/42-School-Exam-Rank-02/issues/1#issuecomment-1032738611, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHPOB6WNM7YPMKM4WR4JZTU2EZR7ANCNFSM5N2AYO6Q . You are receiving this because you authored the thread.Message ID: @.***>

casuis avatar Feb 08 '22 15:02 casuis

Ohh as in remove the i++ from the code.

Don’t worry about your English, it’s pretty good!

pasqualerossi avatar Feb 09 '22 01:02 pasqualerossi