From 4adf590e71761b5272dbba292fcace92afd4d3f2 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 7 Apr 2017 18:20:21 +0800 Subject: [PATCH] esp32-fix-random --- lib/lws-plat-esp32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lws-plat-esp32.c b/lib/lws-plat-esp32.c index e14d96d..c00c933 100644 --- a/lib/lws-plat-esp32.c +++ b/lib/lws-plat-esp32.c @@ -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) -- 2.7.4