[Bug 269688] memalign() produces division by zero if size is 0

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 19 Feb 2023 17:17:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269688

--- Comment #3 from Paul Floyd <pjfloyd@wanadoo.fr> ---
And I would just pass it on to aligned_alloc:

void *
memalign(size_t align, size_t size)
{
        return (aligned_alloc(align, size ? roundup(size, align) : size));
}

-- 
You are receiving this mail because:
You are the assignee for the bug.