This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -48,7 +48,7 @@ bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage
return false;
file.Close();
unsigned num = (unsigned)fileSize / 2;
wchar_t *p = u.GetBuffer(num);
wchar_t *p = u.GetBuf(num);
if (codePage == MY__CP_UTF16)
for (unsigned i = 0; i < num; i++)
{
@@ -65,20 +65,20 @@ bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage
return false;
p[i] = c;
}
u.ReleaseBuffer(num);
p[num] = 0;
u.ReleaseBuf_SetLen(num);
}
else
{
AString s;
char *p = s.GetBuffer((unsigned)fileSize);
char *p = s.GetBuf((unsigned)fileSize);
UInt32 processed;
if (!file.Read(p, (UInt32)fileSize, processed))
return false;
if (processed != fileSize)
return false;
file.Close();
p[processed] = 0;
s.ReleaseBuffer();
s.ReleaseBuf_CalcLen((unsigned)processed);
if (s.Len() != processed)
return false;