summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-04-19 16:06:45 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-23 20:20:41 -0700
commit30623d6ff7bca223f9e1a825e86bd317eef8bf16 (patch)
tree6361fda324a704eba57da102959102a0481e648d
parentb4c4c65a35640e7274ccd4228f62110147878b72 (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>
-rw-r--r--hw/xquartz/console_redirect.c2
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));