From e7e7f8c2edb997e8f05156b40dc4b9fe0c055e7c Mon Sep 17 00:00:00 2001 From: averne Date: Tue, 23 Apr 2019 22:16:32 +0900 Subject: [PATCH] Use sizeof --- include/stratosphere/mitm/mitm_server.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/stratosphere/mitm/mitm_server.hpp b/include/stratosphere/mitm/mitm_server.hpp index f5b27f07..03190e19 100644 --- a/include/stratosphere/mitm/mitm_server.hpp +++ b/include/stratosphere/mitm/mitm_server.hpp @@ -37,8 +37,8 @@ class MitmServer : public IWaitable { Handle query_h = 0; DoWithSmMitmSession([&]() { - strncpy(mitm_name, service_name, 9); - mitm_name[8] = '\x00'; + strncpy(mitm_name, service_name, sizeof(mitm_name)); + mitm_name[sizeof(mitm_name)-1] = '\x00'; if (R_FAILED(smMitMInstall(&this->port_handle, &query_h, mitm_name))) { std::abort(); }