From d93b4614f05f1bcd9f90a22d9101b49ee7514a60 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 15 Jul 2024 10:28:39 +0200 Subject: [PATCH] (submit/cleanup-vidmode-dispatch) Xext: vidmode: ProcVidModeModModeLine(): move len variable into branch scope Semantically these are separate values in each branch any only used there, so it's a bit more clean to move the declaration into the branches. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/vidmode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Xext/vidmode.c b/Xext/vidmode.c index 887625de3..3894fc2f6 100644 --- a/Xext/vidmode.c +++ b/Xext/vidmode.c @@ -748,8 +748,6 @@ VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff); static int ProcVidModeModModeLine(ClientPtr client) { - int len; - /* limited to local-only connections */ if (!VidModeAllowNonLocal && !client->local) return VidModeErrorBase + XF86VidModeClientNotLocal; @@ -759,7 +757,7 @@ ProcVidModeModModeLine(ClientPtr client) if (ClientMajorVersion(client) < 2) { REQUEST(xXF86OldVidModeModModeLineReq) REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq); - len = + int len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq)); if (len != stuff->privsize) @@ -786,7 +784,7 @@ ProcVidModeModModeLine(ClientPtr client) else { REQUEST(xXF86VidModeModModeLineReq); REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq); - len = + int len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeModModeLineReq)); if (len != stuff->privsize)