Remove redundant check

Given that both pointers are not null and the size is a positive
integer, qstrncpy() can never return null.
This commit is contained in:
Vlad Zahorodnii 2021-03-26 13:39:36 +02:00
parent c56712776a
commit 755004acd0

View file

@ -98,9 +98,7 @@ void KeyboardInterfacePrivate::sendKeymap(Resource *resource)
return;
}
if (qstrncpy(reinterpret_cast<char *>(address), keymap.constData(), keymap.size() + 1) == nullptr) {
return;
}
qstrncpy(reinterpret_cast<char *>(address), keymap.constData(), keymap.size() + 1);
tmp->unmap(address);
send_keymap(resource->handle, keymap_format::keymap_format_xkb_v1, tmp->handle(), tmp->size());