From 8c3c20f3fe1777f7971f5c07925492449da52637 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 10 Jun 2025 01:11:31 +0200 Subject: [PATCH] xnest/os: Fix incorrect power of two operator 2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536 Signed-off-by: dec05eba --- hw/xnest/xcb.c | 2 +- os/connection.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xnest/xcb.c b/hw/xnest/xcb.c index 4afabb943..420b399e9 100644 --- a/hw/xnest/xcb.c +++ b/hw/xnest/xcb.c @@ -167,7 +167,7 @@ void xnest_set_command( for (i = 0, nbytes = 0; i < argc; i++) nbytes += strlen(argv[i]) + 1; - if (nbytes >= (2^16) - 1) + if (nbytes >= (1<<16) - 1) return; char *buf = calloc(1, nbytes+1); diff --git a/os/connection.c b/os/connection.c index aeb9baee1..64245af6b 100644 --- a/os/connection.c +++ b/os/connection.c @@ -120,7 +120,7 @@ SOFTWARE. #include "probes.h" #include "xdmcp.h" -#define MAX_CONNECTIONS (2^16) +#define MAX_CONNECTIONS (1<<16) struct ospoll *server_poll;