summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-09-08 19:20:53 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-09-08 20:01:44 -0400
commitafc7f259668bbb25d5b06929d529add93fb39ebf (patch)
tree1a3997e467dc4521a4a35334431bc10cbcddcb6a
parentb62e3f39768cd6fc5db9e4be65b47c53719598c9 (diff)
cppcheck (removing unused assignment lets variable scope reduction)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/Xrender.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xrender.c b/src/Xrender.c
index 7f302f1..5924a5f 100644
--- a/src/Xrender.c
+++ b/src/Xrender.c
@@ -868,7 +868,7 @@ XRenderQueryPictIndexValues(Display *dpy,
xRenderQueryPictIndexValuesReq *req;
xRenderQueryPictIndexValuesReply rep;
XIndexValue *values;
- unsigned int nbytes, nread, rlength, i;
+ unsigned int nbytes, nread, i;
RenderCheckExtension (dpy, info, NULL);
@@ -886,6 +886,7 @@ XRenderQueryPictIndexValues(Display *dpy,
if ((rep.length < (INT_MAX >> 2)) &&
(rep.numIndexValues < (INT_MAX / sizeof (XIndexValue)))) {
+ unsigned int rlength;
/* request data length */
nbytes = rep.length << 2;
/* bytes of actual data in the request */
@@ -896,7 +897,7 @@ XRenderQueryPictIndexValues(Display *dpy,
/* allocate returned data */
values = Xmalloc (rlength);
} else {
- nbytes = nread = rlength = 0;
+ nbytes = nread = 0;
values = NULL;
}