Protect against NULL strings
This commit is contained in:
parent
100e74d8e0
commit
9ddf7c4284
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
coord_t gdispGetStringWidth(const char* str, font_t font) {
|
||||||
|
if (!str)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* No mutex required as we only read static data */
|
/* No mutex required as we only read static data */
|
||||||
return mf_get_string_width(font, str, 0, 0);
|
return mf_get_string_width(font, str, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue