Skip to content

Commit

Permalink
ImmediateAlertService: fix possible bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisNT committed Oct 21, 2023
1 parent 6280d06 commit 82464ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ble/ImmediateAlertService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 82464ad

Please sign in to comment.