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

Reported-by: default avatarJoe Rohde <joer@valvesoftware.com>
Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 30623d6f)
parent 8a48d445
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment