5ddd382a9b
While likely very uncommon, this sanitizes the input and does nothing in the event of the length being equal to or less than zero, avoiding constructing a std::string when there's no need to. It also avoids an out-of-memory scenario, as a negative value would wrap around to its equivalent unsigned representation in std::string's constructor. e.g. If someone was silly and a length of -1 was specified, this would make a string with a length of 0xFFFFFFFFFFFFFFFF on a 64-bit platform, which will obviously eventually fail due to the allocation being way too large. |
||
---|---|---|
.. | ||
applets | ||
kernel | ||
service | ||
config_mem.cpp | ||
config_mem.h | ||
function_wrappers.h | ||
ipc.h | ||
ipc_helpers.h | ||
lock.cpp | ||
lock.h | ||
result.h | ||
romfs.cpp | ||
romfs.h | ||
shared_page.cpp | ||
shared_page.h |