SERVER-12110 Using the safe strcpy_s. The 'num' parameter is the size of the 'buf' array.

This will help protect against buffer overflow and/or heap corruption.