Remove the last memcpy
This is the last memcpy in bmcweb. Remove it in leui of std::bit_cast
Tested: Need help.
Change-Id: Ibd6fbc1a8fa9e80cd7e7edf356f8a45448c16189
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/src/filesystem_log_watcher.cpp b/redfish-core/src/filesystem_log_watcher.cpp
index af4a241..41f2c6a 100644
--- a/redfish-core/src/filesystem_log_watcher.cpp
+++ b/redfish-core/src/filesystem_log_watcher.cpp
@@ -13,6 +13,7 @@
#include <boost/asio/posix/stream_descriptor.hpp>
#include <array>
+#include <bit>
#include <cstddef>
#include <cstring>
#include <fstream>
@@ -125,8 +126,8 @@
std::size_t index = 0;
while ((index + iEventSize) <= bytesTransferred)
{
- struct inotify_event event{};
- std::memcpy(&event, &readBuffer[index], iEventSize);
+ struct inotify_event& event =
+ *std::bit_cast<struct inotify_event*>(&readBuffer[index]);
if (event.wd == dirWatchDesc)
{
if ((event.len == 0) ||