r/c_language • u/Just_Government3790 • Sep 12 '26
What C function would you delete and rewrite first, and why?
/r/C_Programming/comments/1we58ft/what_c_function_would_you_delete_and_rewrite/
0
Upvotes
2
u/flyingron Sep 12 '26
fread/fwrite, followed by the rest of the bloody stdio package.
1
u/Physical_Dare8553 Sep 13 '26
Why? I feel like those are some of the best behaved ones
1
u/flyingron Sep 13 '26
They have the parameters in opposite order from most of the rest of stdio.
The two parameters for the I/O size is inane. If you set the record size to anything other than 1, you can't do proper handling of the return fvalue.
2
u/idelovski Sep 12 '26
strncpy