Corrected a buffer overflow possibility by using vsnprintf instead of vsprintf