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 Jun 30, 2024
1 parent f64f882 commit 62874d3
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 62874d3

Please sign in to comment.