Fix #1447 - typo in mg_random()

This commit is contained in:
Sergey Lyubka 2022-01-14 08:18:28 +00:00
parent 6c79a406cd
commit ad6e395da0
2 changed files with 2 additions and 2 deletions

View File

@ -4245,7 +4245,7 @@ void mg_random(void *buf, size_t len) {
while (len--) *p++ = (unsigned char) (esp_random() & 255);
done = true;
#elif MG_ARCH == MG_ARCH_WIN32
#elif MG_ARCH_UNIX
#elif MG_ARCH == MG_ARCH_UNIX
FILE *fp = fopen("/dev/urandom", "rb");
if (fp != NULL) {
if (fread(buf, 1, len, fp) == len) done = true;

View File

@ -70,7 +70,7 @@ void mg_random(void *buf, size_t len) {
while (len--) *p++ = (unsigned char) (esp_random() & 255);
done = true;
#elif MG_ARCH == MG_ARCH_WIN32
#elif MG_ARCH_UNIX
#elif MG_ARCH == MG_ARCH_UNIX
FILE *fp = fopen("/dev/urandom", "rb");
if (fp != NULL) {
if (fread(buf, 1, len, fp) == len) done = true;