From 72226dc434a5d1c4ec391390fe5f2a2c34287fb3 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 19 Apr 2012 16:06:45 -0700 Subject: XQuartz: Correct calculation of the size of our file descriptor array in console_redirect Reported-by: Joe Rohde Signed-off-by: Jeremy Huddleston (cherry picked from commit 30623d6ff7bca223f9e1a825e86bd317eef8bf16) --- hw/xquartz/console_redirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.2.3