2002.06.27 ~10 bg_lib.c vsnprintf() http://www.linux.ucla.edu/~phaethon/q3a/vsnprintf/vsnprintf.html Probably one of the more subtle omissions in the Q3A game/mod source is snprintf() (and vsnprintf()). This had been on my mind for many months, since I always wondered about buffer-overrun situtations, but I never paid it much heed, relying on "big enough" buffers and va() (with 32KB buffer) to avoid buffer overruns. The lack of snprintf() in Q3VM surfaced again while chatting away on IRC. This time around, I actually felt competent enough to pull off an implementation of vsnprintf(), and did it for the heck of it. Well, actually, I had nothing else to do at the time, but having sprintf() is very handy, especially in Q3VM's limited memory. Basically vsprintf() and three of its support routines were modified to take an extra parameter (the `size' parameter) and add a couple more state variables. A macro was thrown in for simplification, but it makes the code look a little uglier. That was about it.