summaryrefslogtreecommitdiff
path: root/src/components/ble
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-06-16 23:31:40 +0300
committerAvamander <avamander@gmail.com>2021-12-04 22:03:40 +0200
commit4349657f799bed04538d95c8d54653586100e82e (patch)
treed5cedfa91e0064e918ac2d58c47835c97d3cec0d /src/components/ble
parent6e165848161b72d1afa43af6807c654d3fc23d03 (diff)
Minor style improvement
Diffstat (limited to 'src/components/ble')
-rw-r--r--src/components/ble/AlertNotificationService.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/components/ble/AlertNotificationService.cpp b/src/components/ble/AlertNotificationService.cpp
index f616cce8..04819122 100644
--- a/src/components/ble/AlertNotificationService.cpp
+++ b/src/components/ble/AlertNotificationService.cpp
@@ -53,8 +53,9 @@ int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle
// Ignore notifications with empty message
const auto packetLen = OS_MBUF_PKTLEN(ctxt->om);
- if (packetLen <= headerSize)
+ if (packetLen <= headerSize) {
return 0;
+ }
size_t bufferSize = std::min(packetLen + stringTerminatorSize, maxBufferSize);
auto messageSize = std::min(maxMessageSize, (bufferSize - headerSize));