esp32-fix-random

This commit is contained in:
Andy Green 2017-04-07 18:20:21 +08:00
parent 8a74348839
commit 4adf590e71

View file

@ -38,9 +38,10 @@ unsigned long long time_in_microseconds(void)
LWS_VISIBLE int
lws_get_random(struct lws_context *context, void *buf, int len)
{
uint8_t *pb = buf;
while (len) {
uint32_t r = esp_random();
uint8_t *p = (uint8_t *)&r, *pb = buf;
uint8_t *p = (uint8_t *)&r;
int b = 4;
if (len < b)