fix: cv_init — replace memset with value-init to avoid UB on std::vector
Also fix stale path comment in test/test_cv/test_cv.cpp. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
void cv_init(CVState& state) {
|
||||
memset(&state, 0, sizeof(CVState));
|
||||
state = CVState{}; // value-initialize — calls vector default ctor correctly
|
||||
state.next_id = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// firmware/test/test_native/test_cv.cpp
|
||||
// firmware/test/test_cv/test_cv.cpp
|
||||
#include <unity.h>
|
||||
#include <string.h>
|
||||
#include "cv.h"
|
||||
|
||||
Reference in New Issue
Block a user