From e5e534d2369b841b23f4897f4baf4e14d91869bb Mon Sep 17 00:00:00 2001 From: averne Date: Wed, 24 Apr 2019 11:17:43 +0900 Subject: [PATCH] Silence warning via compiler directive --- include/stratosphere/mitm/mitm_server.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/stratosphere/mitm/mitm_server.hpp b/include/stratosphere/mitm/mitm_server.hpp index 03190e19..d6bff695 100644 --- a/include/stratosphere/mitm/mitm_server.hpp +++ b/include/stratosphere/mitm/mitm_server.hpp @@ -36,13 +36,16 @@ class MitmServer : public IWaitable { MitmServer(const char *service_name, unsigned int max_s) : port_handle(0), max_sessions(max_s) { Handle query_h = 0; + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" DoWithSmMitmSession([&]() { - strncpy(mitm_name, service_name, sizeof(mitm_name)); - mitm_name[sizeof(mitm_name)-1] = '\x00'; + strncpy(mitm_name, service_name, 8); + mitm_name[8] = '\x00'; if (R_FAILED(smMitMInstall(&this->port_handle, &query_h, mitm_name))) { std::abort(); } }); + #pragma GCC diagnostic pop RegisterMitmServerQueryHandle(query_h, std::move(ServiceObjectHolder(std::move(std::make_shared>())))); }