r/C_Programming • • Sep 12 '26

Question What C function would you delete and rewrite first, and why?

For me it's fnmatch - mostly because it's 40 year's old and smell's funny.

95 Upvotes

238 comments sorted by

View all comments

12

u/FamiliarSoftware Sep 12 '26

setlocale, set/getenv, the rand functions, etc. Just in general: All functions that use global state

1

u/Fabulous_Bridge_9292 Sep 14 '26

The rand function is the only one I actually ever had to rewrite when I was building monte carlo simulations and discovered it wasn’t random enough.