aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-08-13 00:49:19 +0200
committerJoel Bodenmann <joel@embedded.pro>2016-08-13 00:49:19 +0200
commitb9b555eae26a539ee71b30668f8e3fdb343e6ac1 (patch)
treeae1045f93701b47d56ba84c296b98b8d59d4b832
parent05e29696334064a7fc75a593ca8fe24e81448910 (diff)
downloaduGFX-b9b555eae26a539ee71b30668f8e3fdb343e6ac1.tar.gz
uGFX-b9b555eae26a539ee71b30668f8e3fdb343e6ac1.tar.bz2
uGFX-b9b555eae26a539ee71b30668f8e3fdb343e6ac1.zip
Fixing possible crash when GDISP_NEED_TEXT_WORDWRAP is enabled.
-rw-r--r--docs/releases.txt1
-rw-r--r--src/gdisp/gdisp.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/releases.txt b/docs/releases.txt
index 02b1359b..a0017d85 100644
--- a/docs/releases.txt
+++ b/docs/releases.txt
@@ -7,6 +7,7 @@
FEATURE: Added EXC7200 driver
FEATURE: Added STM32F439i-EVAL board files
FIX: Fixed crash when passing NULL to gwinSetStyle()
+FIX: Fixed potential crash when GDISP_NEED_TEXT_WORDWRAP is turned on
*** Release 2.6 ***
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c
index 4f879291..d25a9d55 100644
--- a/src/gdisp/gdisp.c
+++ b/src/gdisp/gdisp.c
@@ -3170,7 +3170,10 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
/* Callback to render string boxes with word wrap. */
#if GDISP_NEED_TEXT_WORDWRAP
static bool mf_countline_callback(mf_str line, uint16_t count, void *state) {
- int *linecount = (int*)state;
+ (void) line;
+ (void) count;
+
+ uint16_t *linecount = (uint16_t*)state;
(*linecount)++;
return TRUE;