-
Notifications
You must be signed in to change notification settings - Fork 13
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
Wrong return value from snprintf if the buffer is too small #2
Comments
About Personally, I only use I don't like to add the following checks to each call of
I have also seen code in which It makes the code look so ugly :-( And wasn't there also an implementation that returned In Microsoft Visual C,
( and also Indeed I created my own version of printf-stdarg.c, because it is safer, and it uses a small determined amount of stack. It never uses the heap ans it is "interrupt proof". I made it available in my "plus testing projects". This source code is not part of the official FreeRTOS kernel or +TCP libraries. But if you find it convenient, I don't mind to add a configuration macro like Thanks |
@jonathangjertsen : would you like the change that I proposed? Add a config macro like: |
Hi @htibosch sorry for not getting back to you, I changed my usage to not rely on the return value of |
https://cplusplus.com/reference/cstdio/snprintf/ says:
The snprintf implementation in this repo instead returns the size of the buffer.
It seems that printf-stdarg.c has been ported from somewhere else, where is it originally from?
The text was updated successfully, but these errors were encountered: