X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=blobdiff_plain;f=src%2FGit%2FGit.cpp;h=86a3e59383274d66d30cce4574cfe716474d3f04;hp=97885fad65ccf69c4a41f05b3e15ebfa576243b8;hb=3ca36842d42feece8d5728e5b81959afbe4005ba;hpb=3549f7262844f0579ed88d2b05356b117e59b5f6 diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 97885fa..86a3e59 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -74,18 +74,23 @@ int CGit::RunAsync(CString cmd,PROCESS_INFORMATION *piOut,HANDLE *hReadOut,CStri } //Must use sperate function to convert ANSI str to union code string //Becuase A2W use stack as internal convert buffer. -void CGit::StringAppend(CString *str,BYTE *p,int code) +void CGit::StringAppend(CString *str,BYTE *p,int code,int length) { //USES_CONVERSION; //str->Append(A2W_CP((LPCSTR)p,code)); WCHAR * buf; - int len = strlen((const char*)p); + + int len ; + if(length<0) + len= strlen((const char*)p); + else + len=length; //if (len==0) // return ; //buf = new WCHAR[len*4 + 1]; buf = str->GetBuffer(len*4+1+str->GetLength())+str->GetLength(); SecureZeroMemory(buf, (len*4 + 1)*sizeof(WCHAR)); - MultiByteToWideChar(code, 0, (LPCSTR)p, -1, buf, len*4); + MultiByteToWideChar(code, 0, (LPCSTR)p, len, buf, len*4); str->ReleaseBuffer(); //str->Append(buf); //delete buf;