XQuartz: Correct calculation of the size of our file descriptor array in console_redirect

Reported-by: Joe Rohde <joer@valvesoftware.com>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston 2012-04-19 16:06:45 -07:00
parent b4c4c65a35
commit 30623d6ff7

View File

@ -336,7 +336,7 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd)
{
/* Reallocate if we need more space */
if (fd >= n_redirect_fds) {
size_t new_n = 1 << (ffs(fd) + 1);
size_t new_n = 1 << (fls(fd) + 1);
asl_redirect *new_array =
realloc(redirect_fds, new_n *
sizeof(*redirect_fds));