style: Changing the strchr to strchr_index

This commit is contained in:
Raphael 2025-12-21 00:18:11 +01:00
parent 9b8c3b203c
commit 8445a8c956
No known key found for this signature in database

View file

@ -6,7 +6,7 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */ /* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/18 17:12:02 by rparodi #+# #+# */ /* Created: 2023/11/18 17:12:02 by rparodi #+# #+# */
/* Updated: 2023/11/22 13:31:13 by rparodi ### ########.fr */ /* Updated: 2025/12/20 23:59:09 by rparodi ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -21,7 +21,7 @@ char *ft_check(char *memory, int fd)
buffer = (char *)malloc(sizeof(char) * (BUFFER_SIZE + 1)); buffer = (char *)malloc(sizeof(char) * (BUFFER_SIZE + 1));
if (!buffer) if (!buffer)
return (NULL); return (NULL);
while (ft_strchr(memory, '\n') <= 0 && bytescopy) while (ft_strchr_index(memory, '\n') <= 0 && bytescopy)
{ {
bytescopy = read(fd, buffer, BUFFER_SIZE); bytescopy = read(fd, buffer, BUFFER_SIZE);
if (bytescopy == -1) if (bytescopy == -1)