forked from external/yambar
particle/string: don’t try to call c32len() on a NULL string
This commit is contained in:
parent
1b03bd6bc0
commit
605a6a9ede
2 changed files with 3 additions and 1 deletions
|
@ -100,6 +100,8 @@
|
||||||
device yambar is already tracking ([#177][177]).
|
device yambar is already tracking ([#177][177]).
|
||||||
* Crash when a particle is “too wide”, and tries to render outside the
|
* Crash when a particle is “too wide”, and tries to render outside the
|
||||||
bar ([#198][198]).
|
bar ([#198][198]).
|
||||||
|
* string: crash when failing to convert string to UTF-32.
|
||||||
|
|
||||||
|
|
||||||
[169]: https://codeberg.org/dnkl/yambar/issues/169
|
[169]: https://codeberg.org/dnkl/yambar/issues/169
|
||||||
[172]: https://codeberg.org/dnkl/yambar/issues/172
|
[172]: https://codeberg.org/dnkl/yambar/issues/172
|
||||||
|
|
|
@ -176,7 +176,7 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
|
||||||
|
|
||||||
/* Not in cache - we need to rasterize it. First, convert to char32_t */
|
/* Not in cache - we need to rasterize it. First, convert to char32_t */
|
||||||
wtext = ambstoc32(text);
|
wtext = ambstoc32(text);
|
||||||
size_t chars = c32len(wtext);
|
size_t chars = wtext != NULL ? c32len(wtext) : 0;
|
||||||
|
|
||||||
/* Truncate, if necessary */
|
/* Truncate, if necessary */
|
||||||
if (p->max_len > 0 && chars > p->max_len) {
|
if (p->max_len > 0 && chars > p->max_len) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue