summaryrefslogtreecommitdiff
path: root/src/xftdraw.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/xftdraw.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/xftdraw.c')
-rw-r--r--src/xftdraw.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xftdraw.c b/src/xftdraw.c
index ca9286a..c1bd9a4 100644
--- a/src/xftdraw.c
+++ b/src/xftdraw.c
@@ -548,6 +548,9 @@ XftDrawString16 (XftDraw *draw,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -576,6 +579,9 @@ XftDrawString32 (XftDraw *draw,
FT_UInt *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -607,6 +613,9 @@ XftDrawStringUtf8 (XftDraw *draw,
int l;
int size;
+ if (len <= 0)
+ return;
+
i = 0;
glyphs = glyphs_local;
size = NUM_LOCAL;
@@ -652,6 +661,9 @@ XftDrawStringUtf16 (XftDraw *draw,
int l;
int size;
+ if (len <= 0)
+ return;
+
i = 0;
glyphs = glyphs_local;
size = NUM_LOCAL;
@@ -755,6 +767,9 @@ XftDrawCharSpec (XftDraw *draw,
XftGlyphSpec *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else
@@ -784,6 +799,9 @@ XftDrawCharFontSpec (XftDraw *draw,
XftGlyphFontSpec *glyphs, glyphs_local[NUM_LOCAL];
int i;
+ if (len <= 0)
+ return;
+
if (len <= NUM_LOCAL)
glyphs = glyphs_local;
else