fc_vsnprintf() documented to follow C99, implementation C89 one
While we should fix fc_vsnprintf() to return C99 compatible value when ever possible, there's nothing we can do if the underlying vsnprintf() implementation is not behaving.
- Update the configure check for what is considerd acceptable vsnprintf() implementation -> #45630
- Having fc_vsnprinf() to return C99 value at least most of the time (instead of always returning C89 value) fixes some users, and is unlikely to break any
While working on this, found #45682, that I think needs to be resolved first (considered a dependency of this)
Probably first make boundary check improvements in #45719
Meant also to S2_6
fc_vsnprintf() function header discuss return value, and states that C99 is followed: "If truncation does occur, returns the number of characters which would have been produced without truncation."
The implementation, on the other hand, converts any C99 values to C89 (-1 on truncation), and not vice versa:
/* Convert C99 return value to C89. */ if (r >= n) {
}