diff options
Diffstat (limited to 'CPP/Common/ListFileUtils.cpp')
-rw-r--r-- | CPP/Common/ListFileUtils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CPP/Common/ListFileUtils.cpp b/CPP/Common/ListFileUtils.cpp index 313532ef..3bf4ec29 100644 --- a/CPP/Common/ListFileUtils.cpp +++ b/CPP/Common/ListFileUtils.cpp @@ -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; |