diff --git a/src/xrt/drivers/steamvr_lh/device.cpp b/src/xrt/drivers/steamvr_lh/device.cpp index a8eeae07b..928f0e185 100644 --- a/src/xrt/drivers/steamvr_lh/device.cpp +++ b/src/xrt/drivers/steamvr_lh/device.cpp @@ -18,6 +18,7 @@ #include "util/u_device.h" #include "util/u_logging.h" #include "util/u_json.hpp" +#include "xrt/xrt_device.h" #define DEV_ERR(...) U_LOG_IFL_E(ctx->log_level, __VA_ARGS__) #define DEV_WARN(...) U_LOG_IFL_W(ctx->log_level, __VA_ARGS__) @@ -95,7 +96,8 @@ ControllerDevice::ControllerDevice(vr::PropertyContainerHandle_t handle, const D Device::Device(const DeviceBuilder &builder) : xrt_device({}), ctx(builder.ctx), driver(builder.driver) { - std::strncpy(this->serial, builder.serial, XRT_DEVICE_NAME_LEN); + std::strncpy(this->serial, builder.serial, XRT_DEVICE_NAME_LEN - 1); + this->serial[XRT_DEVICE_NAME_LEN - 1] = 0; this->tracking_origin = ctx.get(); this->orientation_tracking_supported = true; this->position_tracking_supported = true; diff --git a/src/xrt/drivers/steamvr_lh/interfaces/paths.hpp b/src/xrt/drivers/steamvr_lh/interfaces/paths.hpp index 5ed1fb4c2..980cd8949 100644 --- a/src/xrt/drivers/steamvr_lh/interfaces/paths.hpp +++ b/src/xrt/drivers/steamvr_lh/interfaces/paths.hpp @@ -14,7 +14,7 @@ namespace vr { inline const char *IVRPaths_Version = "IVRPaths_001"; typedef uint64_t PathHandle_t; -}; // namespace vr +} // namespace vr /** This interface is missing in the C++ header but present in the C one, and the lighthouse driver requires it. */ class Paths diff --git a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp index 175aef989..56b85c235 100644 --- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp +++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp @@ -24,7 +24,8 @@ #include "util/u_device.h" namespace { -DEBUG_GET_ONCE_LOG_OPTION(lh_log, "LIGHTHOUSE_LOG", U_LOGGING_INFO); + +DEBUG_GET_ONCE_LOG_OPTION(lh_log, "LIGHTHOUSE_LOG", U_LOGGING_INFO) // ~/.steam/root is a symlink to where the Steam root is const std::string STEAM_INSTALL_DIR = std::string(getenv("HOME")) + "/.steam/root";