#ifndef ARES_CRT_H_ #define ARES_CRT_H_ class AresCRT { public: // these two are saner mechanisms for string copying // copy up to Count chars using strncpy // force (Count - 1)th char to \0 // which means you pass the full length of the char[]/wchar_t[] as Count and it will not overflow // it doesn't mean you can copy strings without thinking static void strCopy(char *Dest, const char *Source, size_t Count); static void wstrCopy(wchar_t *Dest, const wchar_t *Source, size_t Count); template static void strCopy(char (&Dest)[Size], const char *Source) { strCopy(Dest, Source, Size); } template static void wstrCopy(wchar_t (&Dest)[Size], const wchar_t *Source) { wstrCopy(Dest, Source, Size); } }; #endif