Windows7ThumbBar: Use QString length instead of count

This commit is contained in:
Jonas Kvinge 2022-10-01 14:03:28 +02:00
parent 59a7835ace
commit 5b7f507d9b
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ void Windows7ThumbBar::SetupButton(const QAction *action, THUMBBUTTON *button) {
button->dwFlags = action->isEnabled() ? THBF_ENABLED : THBF_DISABLED;
// This is unsafe - doesn't obey 260-char restriction
action->text().toWCharArray(button->szTip);
button->szTip[action->text().count()] = L'\0';
button->szTip[action->text().length()] = L'\0';
if (!action->isVisible()) {
button->dwFlags = THUMBBUTTONFLAGS(button->dwFlags | THBF_HIDDEN);