What does the debugger say ? It can crash in many ways. Maybe you could use a large static buffer: char dest[1000]; and use vsnprintf, vswprintf instead.