mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-06-21 11:02:45 +02:00
Fix compiler warning when service string is exactly 8 characters (#9)
* Fix compiler warning when service string is exactly 8 characters * Use sizeof * Silence warning via compiler directive
This commit is contained in:
parent
79bc9bf8d8
commit
b0a0754ce6
@ -36,6 +36,8 @@ 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, 8);
|
||||
mitm_name[8] = '\x00';
|
||||
@ -43,6 +45,7 @@ class MitmServer : public IWaitable {
|
||||
std::abort();
|
||||
}
|
||||
});
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
RegisterMitmServerQueryHandle(query_h, std::move(ServiceObjectHolder(std::move(std::make_shared<MitmQueryService<T>>()))));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user