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

Commit e2e2b2d3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix error checking in append_string"

parents ee08c978 3bbc2402
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static void append_byte_array(struct stats_event* event, const uint8_t* buf, siz
// 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;
    }