Hi,
It seems that snprintf is broken in MDK 4.72 and Microlib.
My intention was to use it to pre-calculate the size of the formatted output, and thus I gave it a NULL-pointer and a buffer size of 0, like so:
n = snprintf(NULL, 0, "test");
According to the standard, this is allowable, but instead it crashes my application (it tries to write to the NULL-pointer).
In short, it always tries to write to the buffer, no matter if the length is zero or the buffer is a NULL-pointer (or both).
I haven't seen if it behaves properly with the standard library, because I prefer Microlib for size.
My post was actually meant as a heads-up for other users. I decided to just avoid using it in my code.
I am aware that Keil isn't (actively) monitoring these forums, but thanks for the reminder anyway.