Protect against NULL strings

remotes/origin_old/ugfx_release_2.6
inmarket 2015-01-03 18:41:11 +10:00
parent 100e74d8e0
commit 9ddf7c4284
1 changed files with 3 additions and 0 deletions

View File

@ -3312,6 +3312,9 @@ void gdispGDrawBox(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, co
}
coord_t gdispGetStringWidth(const char* str, font_t font) {
if (!str)
return 0;
/* No mutex required as we only read static data */
return mf_get_string_width(font, str, 0, 0);
}