Skip to content

Commit

Permalink
Fix windows warning (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
  • Loading branch information
ivanpauno authored Apr 3, 2020
1 parent 46d41b6 commit 052acc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rmw_dds_common/test/test_graph_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <string.h>

#include <cstring>
#include <string>
#include <tuple>
#include <utility>
Expand Down Expand Up @@ -192,10 +192,10 @@ gid_from_string(const std::string & str)
{
rmw_gid_t gid = {};
EXPECT_LT(str.size(), RMW_GID_STORAGE_SIZE);
std::strncpy(
memcpy(
reinterpret_cast<char *>(gid.data),
str.c_str(),
RMW_GID_STORAGE_SIZE);
str.size() + 1);
return gid;
}

Expand Down Expand Up @@ -385,10 +385,10 @@ gid_msg_from_string(const std::string & str)
rmw_dds_common::msg::Gid gid;
gid.data = {};
EXPECT_LT(str.size(), RMW_GID_STORAGE_SIZE);
std::strncpy(
memcpy(
reinterpret_cast<char *>(gid.data.data()),
str.c_str(),
RMW_GID_STORAGE_SIZE);
str.size() + 1);
return gid;
}

Expand Down

0 comments on commit 052acc3

Please sign in to comment.