projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
991f6ec
)
esp32: return random count
author
Andy Green
<andy@warmcat.com>
Fri, 28 Apr 2017 03:53:28 +0000
(11:53 +0800)
committer
Andy Green
<andy@warmcat.com>
Fri, 28 Apr 2017 03:53:28 +0000
(11:53 +0800)
lib/lws-plat-esp32.c
patch
|
blob
|
history
diff --git
a/lib/lws-plat-esp32.c
b/lib/lws-plat-esp32.c
index
c00c933
..
1f58945
100644
(file)
--- a/
lib/lws-plat-esp32.c
+++ b/
lib/lws-plat-esp32.c
@@
-39,6
+39,7
@@
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;
@@
-53,7
+54,7
@@
lws_get_random(struct lws_context *context, void *buf, int len)
*pb++ = p[b];
}
- return
0
;
+ return
pb - (uint8_t *)buf
;
}
LWS_VISIBLE int