Skip to content

snprintf() and vsnprintf() return value comment #45

@vgrudenic

Description

@vgrudenic

Hi, just a tiny remark: the comment for snprintf/vsnprintf seems to be incorrect:

(returns) The number of characters that are WRITTEN into the buffer, not counting the terminating null character. If the formatted string is truncated the buffer size (count) is returned

The description in the readme file is ok:

Anyway, if the output was truncated due to this limit, the return value is the number of characters that could have been written. Notice that a value equal or larger than count indicates a truncation.

I made a quick update so I'll place a PR (I didn't find the -1 being returned from anywhere in case of errors, so I didn't mention it explicitly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions