ImmediateAlertService: fix possible bug

This commit is contained in:
Davis Mosenkovs 2023-10-21 00:48:59 +03:00
parent eeb0d23816
commit 565ed00cee

View file

@ -63,7 +63,8 @@ int ImmediateAlertService::OnAlertLevelChanged(uint16_t attributeHandle, ble_gat
auto* alertString = ToString(alertLevel);
NotificationManager::Notification notif;
std::memcpy(notif.message.data(), alertString, strlen(alertString));
std::memcpy(notif.message.data(), alertString, strlen(alertString) + 1);
notif.size = strlen(alertString) + 1;
notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert;
notificationManager.Push(std::move(notif));