Skip to content

Doesn't correct check ft_strnew #128

Description

@npiatiko

Not correct, but successful checked by 42filechecker end validated by MOULINETTE :

char	*ft_strnew(size_t size)
{
	char *str;

	if ((str = (char*)malloc(++size)) == 0)
		return (NULL);
	while (size)
	{
		*(str + size) = '\0';
		size--;
	}
	*str = '\0';
	return (str);
}

PS problem in ++size

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions