Use C++ strcpy_arr in xml_native_reader_test.

PiperOrigin-RevId: 455375707
Change-Id: Ia3dbb11886ab29c4ad3192e4f78b4b60b94baad0
This commit is contained in:
Alessio Quaglino
2022-06-16 07:14:25 -07:00
committed by Copybara-Service
parent 307cf692e5
commit 69a506e6ba
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -15,6 +15,10 @@
#ifndef MUJOCO_SRC_ENGINE_ENGINE_ARRAY_SAFETY_H_
#define MUJOCO_SRC_ENGINE_ENGINE_ARRAY_SAFETY_H_
#ifdef __cplusplus
#error This file should not be used from C++ code.
#endif
#include <stdio.h>
#include <string.h>
+2 -2
View File
@@ -22,7 +22,7 @@
#include <gtest/gtest.h>
#include <mujoco/mjmodel.h>
#include <mujoco/mujoco.h>
#include "src/engine/engine_array_safety.h"
#include "src/cc/array_safety.h"
#include "src/engine/engine_util_errmem.h"
#include "test/fixture.h"
@@ -147,7 +147,7 @@ TEST_F(UserDataTest, RaiseNanWarning) {
static char warning[1024];
warning[0] = '\0';
mju_user_warning = [](const char* msg) {
mjSTRNCPY(warning, msg);
util::strcpy_arr(warning, msg);
};
mjModel* model = LoadModelFromString(xml, error.data(), error.size());
#if defined(_WIN32) || defined(__CYGWIN__)