This commit is contained in:
Ordinary205 2024-04-23 20:21:07 +04:00
parent aad0ad40f2
commit 8ed37c12b0

View File

@ -12,8 +12,12 @@ EXPORT const char* MODULE_NAME = "libSceRandom";
EXPORT SYSV_ABI int32_t sceRandomGetRandomNumber(void* buf, uint32_t size) {
LOG_USE_MODULE(libSceRandom);
if (buf == nullptr || size > Err::RANDOM_MAX_SIZE) {
if (size > Err::RANDOM_MAX_SIZE) {
return EINVAL;
}
for (uint32_t i = 0; i < size; ++i) {
((uint8_t*)buf)[i] = std::rand() & 0xFF;
}
return 0;
}
}