Fix error checking in append_string
Test: m -j Change-Id: Ifa806d5037acb17f83cbf45712e9795d6f56152f
This commit is contained in:
parent
27fa358d41
commit
3bbc240263
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue