diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2012-04-19 16:06:45 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-04-26 21:07:08 -0700 |
commit | 72226dc434a5d1c4ec391390fe5f2a2c34287fb3 (patch) | |
tree | 4dbceccb34f0112ddd2cf1079df450522230d402 | |
parent | 8a48d44574375ba4fa85c5a59678998811ea4e80 (diff) |
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>
(cherry picked from commit 30623d6ff7bca223f9e1a825e86bd317eef8bf16)
-rw-r--r-- | hw/xquartz/console_redirect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 7b92eca39..1e0e56bad 100644 --- a/hw/xquartz/console_redirect.c +++ b/hw/xquartz/console_redirect.c @@ -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)); |