Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • strncpy() is a bad example for anything, as it isn't actually a string function. Commented Jan 24, 2024 at 6:39
  • @Deduplicator: It is a string function in the sense that processing of the input buffer stops if a '\0' terminator is found. Commented Jan 25, 2024 at 22:01
  • @BenVoigt But it's not one in that the whole output buffer is always written, and the zero tail-padding might be non-existent. The fact processing the input buffer also stops when the output buffer is full could be argued either way. Anyway, it is better avoided as an example. Commented Jan 25, 2024 at 23:55