arc4random sizeof typo
Lorenzo Beretta <[email protected]> Mon, 25 May 2015 18:16:04 +0200
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <[email protected]> |
static uint32_t buf[256];
static unsigned int n;
uint32_t arc4random(void) {
if (n+1>sizeof(buf)) arc4random_stir();
return buf[n++];
}
should be "sizeof(buf) / sizeof(buf[0])" or similar
lorenzo