From 183267b8bc283756c4868d1ae3adb47a15d5f64b Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 17 Jun 2025 18:48:49 +0200 Subject: [PATCH] dix: Dispatch() separate variable for read result Mixing result variables for separate things is making the code hard to understand, so add a new local variable for temporarily storing the result of ReadRequestFromClient(). Signed-off-by: Enrico Weigelt, metux IT consult --- dix/dispatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dix/dispatch.c b/dix/dispatch.c index c84353d848..85d14c4893 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -519,10 +519,10 @@ Dispatch(void) } /* now, finally, deal with client requests */ - result = ReadRequestFromClient(client); - if (result == 0) + long read_result = ReadRequestFromClient(client); + if (read_result == 0) break; - else if (result == -1) { + else if (read_result == -1) { CloseDownClient(client); break; } @@ -544,7 +544,7 @@ Dispatch(void) client->index, client->requestBuffer); #endif - if (result < 0 || result > (maxBigRequestSize << 2)) + if (read_result < 0 || read_result > (maxBigRequestSize << 2)) result = BadLength; else { result = XaceHookDispatch(client, client->majorOp);