Avoid using _s CRT functions for XP compatibility