mirror of
https://github.com/SysRay/psOff_public.git
synced 2025-02-17 04:50:09 +00:00
+
This commit is contained in:
parent
aad0ad40f2
commit
8ed37c12b0
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user