diff --git a/objdump.cpp b/objdump.cpp index 76caef1c9b..7955462557 100644 --- a/objdump.cpp +++ b/objdump.cpp @@ -25,6 +25,7 @@ #include #include #include +#include std::string to_hex(std::uint64_t value, bool prfx = true) { @@ -85,7 +86,7 @@ int main(int argc, char* argv[]) // Decode address and try to find the object std::uint64_t addr = -1; - std::from_chars(arg.data() + strlen("--start-address=0x"), arg.data() + arg.size(), addr, 16); + std::from_chars(arg.data() + ("--start-address=0x"sv).size(), arg.data() + arg.size(), addr, 16); for (int j = 0; j < 0x100'0000; j++) { diff --git a/rpcs3/Emu/NP/np_handler.cpp b/rpcs3/Emu/NP/np_handler.cpp index b64fad1767..30eac7f470 100644 --- a/rpcs3/Emu/NP/np_handler.cpp +++ b/rpcs3/Emu/NP/np_handler.cpp @@ -646,7 +646,7 @@ namespace np for (; it != end; ++it) { - strcpy(ifr.ifr_name, it->ifr_name); + strcpy_trunc(ifr.ifr_name, it->ifr_name); if (ioctl(sock, SIOCGIFFLAGS, &ifr) == 0) { if (!(ifr.ifr_flags & IFF_LOOPBACK)) diff --git a/rpcs3/Input/gui_pad_thread.cpp b/rpcs3/Input/gui_pad_thread.cpp index e3401c94a9..666bf329ac 100644 --- a/rpcs3/Input/gui_pad_thread.cpp +++ b/rpcs3/Input/gui_pad_thread.cpp @@ -169,7 +169,7 @@ bool gui_pad_thread::init() usetup.id.bustype = BUS_USB; usetup.id.vendor = 0x1234; usetup.id.product = 0x1234; - std::strcpy(usetup.name, "RPCS3 GUI Input Device"); + strcpy_trunc(usetup.name, "RPCS3 GUI Input Device"sv); // The ioctls below will enable the device that is about to be created to pass events. CHECK_IOCTRL_RET(ioctl(m_uinput_fd, UI_SET_EVBIT, EV_KEY)); diff --git a/rpcs3/Loader/PSF.cpp b/rpcs3/Loader/PSF.cpp index ee88424608..91afc6b980 100644 --- a/rpcs3/Loader/PSF.cpp +++ b/rpcs3/Loader/PSF.cpp @@ -253,7 +253,7 @@ namespace psf if (indices[i].param_fmt == format::string) { // Find null terminator - value.resize(std::strlen(value.c_str())); + value.resize(value.find_first_of('\0')); } result.sfo.emplace(std::piecewise_construct,