Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had to check the author ...learned that Thingiverse are Swedish, based in Stockholm even.

The article was written Adam Dunkels who is certainly not without creds in the embedded world. Why whould he show the code to rand_r() in an article about rand()? So confused now.




You shouldn't be confused if you read the article. The actual PRNG is implemented in rand_r() and is the first place most people would look. The issue is in the reentrant wrapper in rand().


I seem to be catching downvotes, but I did read the article. The text right before the rand_r() code box reads:

This is the code of the rand() function, which looks familiar:

That has to count as at least a typo, but I think it's a bigger editing-type problem.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: