Commit 8902f818 authored by Chen Bill's avatar Chen Bill Committed by GitHub

BufferIO: update CopyWStr (#2554)

parent e209e775
...@@ -29,7 +29,7 @@ public: ...@@ -29,7 +29,7 @@ public:
} }
// return: string length // return: string length
template<typename T1, typename T2> template<typename T1, typename T2>
inline static int CopyWStr(T1* src, T2* pstr, int bufsize) { inline static int CopyWStr(const T1* src, T2* pstr, int bufsize) {
int l = 0; int l = 0;
while(src[l] && l < bufsize - 1) { while(src[l] && l < bufsize - 1) {
pstr[l] = (T2)src[l]; pstr[l] = (T2)src[l];
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
return l; return l;
} }
template<typename T1, typename T2> template<typename T1, typename T2>
inline static int CopyWStrRef(T1* src, T2*& pstr, int bufsize) { inline static int CopyWStrRef(const T1* src, T2*& pstr, int bufsize) {
int l = 0; int l = 0;
while(src[l] && l < bufsize - 1) { while(src[l] && l < bufsize - 1) {
pstr[l] = (T2)src[l]; pstr[l] = (T2)src[l];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment