summaryrefslogtreecommitdiff
path: root/src/xftrender.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-05-30 15:15:11 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-06-03 15:52:58 -0400
commit06a3c0ab6520e368ac936cb1ef172f19957db0fa (patch)
tree6945e05dec70f636e4730583b43bef2f835fa6c8 /src/xftrender.c
parent4342ea4b4b87790004f6883a0d5b36fdff7c0443 (diff)
downloadxorg-lib-libXft-06a3c0ab6520e368ac936cb1ef172f19957db0fa.tar.gz
fix warnings by gcc 11; check if length <= zero
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftrender.c')
-rw-r--r--src/xftrender.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/xftrender.c b/src/xftrender.c
index 8bc068a..dee7943 100644
--- a/src/xftrender.c
+++ b/src/xftrender.c
@@ -362,6 +362,9 @@ XftCharSpecRender (Display *dpy,
XftGlyphSpec *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -652,6 +655,9 @@ XftCharFontSpecRender (Display *dpy,
XftGlyphFontSpec *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -689,6 +695,9 @@ XftTextRender8 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -721,6 +730,9 @@ XftTextRender16 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -753,6 +765,9 @@ XftTextRender16BE (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -786,6 +801,9 @@ XftTextRender16LE (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -819,6 +837,9 @@ XftTextRender32 (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -851,6 +872,9 @@ XftTextRender32BE (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -887,6 +911,9 @@ XftTextRender32LE (Display *dpy,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -926,6 +953,9 @@ XftTextRenderUtf8 (Display *dpy,
int l;
int size;
+ if (len <= 0)
+ return;
+
i = 0;
glyphs = glyphs_local;
size = NUM_LOCAL;
@@ -976,6 +1006,9 @@ XftTextRenderUtf16 (Display *dpy,
int l;
int size;
+ if (len <= 0)
+ return;
+
i = 0;
glyphs = glyphs_local;
size = NUM_LOCAL;