Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bbc2402 authored by Ruchir Rastogi's avatar Ruchir Rastogi
Browse files

Fix error checking in append_string

Test: m -j
Change-Id: Ifa806d5037acb17f83cbf45712e9795d6f56152f
parent 27fa358d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ static void append_byte_array(struct stats_event* event, uint8_t* buf, size_t si
// Side-effect: modifies event->errors if buf is not properly null-terminated
static void append_string(struct stats_event* event, const char* buf) {
    size_t size = strnlen(buf, MAX_EVENT_PAYLOAD);
    if (event->errors) {
    if (size == MAX_EVENT_PAYLOAD) {
        event->errors |= ERROR_STRING_NOT_NULL_TERMINATED;
        return;
    }