Merge "Fix error checking in append_string" am: e2e2b2d3d3 am: 33e2002540
Change-Id: Ia3c7b38e0400ebd045fa67cfa914f7880840e77d
This commit is contained in:
commit
b2140e1246
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue