Enable cppcoreguidelines-avoid-c-arrays
We only had one pretty trivial use of a C array in dbus-sensors.
Replace that with std::array, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5ecbfa07a7f46977dc3ccbde3c4b385e95b6a730
diff --git a/tests/test_Utils.cpp b/tests/test_Utils.cpp
index 6f76933..b454716 100644
--- a/tests/test_Utils.cpp
+++ b/tests/test_Utils.cpp
@@ -1,5 +1,6 @@
#include <Utils.hpp>
+#include <array>
#include <filesystem>
#include <fstream>
@@ -15,8 +16,8 @@
TestUtils()
{
// Create test environment
- char dir[] = "./testDirXXXXXX";
- testDir = mkdtemp(dir);
+ auto dir = std::to_array("./testDirXXXXXX");
+ testDir = mkdtemp(dir.data());
if (testDir.empty())
{