<html><head></head><body>That __MIN kludge is not namespace-safe. No thanks. And the whole concept is intrinsically broken as a correct min macro would *really* need to be both expansion-safe (__MIN is not) and constant-safe.<br><br><div class="gmail_quote">Le 8 avril 2020 01:04:26 GMT+03:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> src/posix/rand.c | 6 ++----<br> 1 file changed, 2 insertions(+), 4 deletions(-)<br><br>diff --git a/src/posix/rand.c b/src/posix/rand.c<br>index 1c258055b7..a1c8ac9602 100644<br>--- a/src/posix/rand.c<br>+++ b/src/posix/rand.c<br>@@ -105,13 +105,11 @@ void vlc_rand_bytes (void *buf, size_t len)<br>         vlc_hash_md5_Update (&mdo, mdi_buf, sizeof(mdi_buf));<br>         vlc_hash_md5_Finish (&mdo, mdo_buf, sizeof(mdo_buf));<br> <br>+        memcpy (buf, mdo_buf, __MIN(len, sizeof(mdo_buf)));<br>+<br>         if (len < sizeof(mdo_buf))<br>-        {<br>-            memcpy (buf, mdo_buf, len);<br>             break;<br>-        }<br> <br>-        memcpy (buf, mdo_buf, sizeof(mdo_buf));<br>         len -= 16;<br>         buf = ((uint8_t *)buf) + 16;<br>     }</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>