News for hackers. Stuff that matters.
Re:The Sad State of C Strings by anon4 on Wednesday February 10, 2016 @06:58AM (#11072151)
Good, but I'd do one modification -- always write a null byte at the end. Otherwise you end up with a non-null-terminated string and that's bad.

So,

  copy_sz = src_sz < (dest_sz - dest_off) ? src_sz : (dest_sz - dest_off - 1);
  ...
  *dest_end = '\0';

There are no comments on this comment yet.