Comment by froh
4 years ago
fmemopen takes the buffer length, and there is no need to have the buffer \0 terminated, so instead of strlen you can also just give the buffer size.
The number of bytes parsed can be fetched with the scanf %n format specifier.
No comments yet
Contribute on Hacker News ↗