Comment

Comment by bio_end_io_t

The author should've been wary of strncpy, because his solution is wrong.

"If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated."

So copying sizeof(dest)-1 will not append a NULL byte as the author implies. You'll have to do that manually.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton