Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vgrudenic opened this issue Apr 5, 2019 · 1 comment
Closed

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

vgrudenic opened this issue Apr 5, 2019 · 1 comment

Comments

@vgrudenic
Copy link
Contributor

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).

@mpaland
Copy link
Owner

mpaland commented Apr 5, 2019

Thanks a lot for the PR, Vedran.

@mpaland mpaland closed this as completed Apr 5, 2019
LukeShu pushed a commit to LukeShu/pico-fmt that referenced this issue Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants