Fixes following issues using MSVCRT _snprintf:
- Failure to null terminate all strings
- Failure to return number of characters that would've been
printed had the buffer been sufficiently large
- Failure to accept size = 0 (and str = NULL) to determine
final output length.
NB, the third issue above is fixed on *some* win32 implementations,
however it is not officially documented as being so.
Signed-off-by: David Flynn <davidf@rd.bbc.co.uk> Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>