aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/ListFileUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/Common/ListFileUtils.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/CPP/Common/ListFileUtils.cpp b/CPP/Common/ListFileUtils.cpp
index e43dbc9..714b275 100644
--- a/CPP/Common/ListFileUtils.cpp
+++ b/CPP/Common/ListFileUtils.cpp
@@ -76,26 +76,26 @@ bool ReadNamesFromListFile2(CFSTR fileName, UStringVector &strings, UINT codePag
76 return false; 76 return false;
77 77
78 file.Close(); 78 file.Close();
79 const unsigned num = (unsigned)fileSize / 2; 79 const size_t num = (size_t)fileSize / 2;
80 wchar_t *p = u.GetBuf(num); 80 wchar_t *p = u.GetBuf((unsigned)num);
81 if (codePage == Z7_WIN_CP_UTF16) 81 if (codePage == Z7_WIN_CP_UTF16)
82 for (unsigned i = 0; i < num; i++) 82 for (size_t i = 0; i < num; i++)
83 { 83 {
84 wchar_t c = GetUi16(buf + (size_t)i * 2); 84 const wchar_t c = GetUi16(buf.ConstData() + (size_t)i * 2);
85 if (c == 0) 85 if (c == 0)
86 return false; 86 return false;
87 p[i] = c; 87 p[i] = c;
88 } 88 }
89 else 89 else
90 for (unsigned i = 0; i < num; i++) 90 for (size_t i = 0; i < num; i++)
91 { 91 {
92 wchar_t c = (wchar_t)GetBe16(buf + (size_t)i * 2); 92 const wchar_t c = (wchar_t)GetBe16(buf.ConstData() + (size_t)i * 2);
93 if (c == 0) 93 if (c == 0)
94 return false; 94 return false;
95 p[i] = c; 95 p[i] = c;
96 } 96 }
97 p[num] = 0; 97 p[num] = 0;
98 u.ReleaseBuf_SetLen(num); 98 u.ReleaseBuf_SetLen((unsigned)num);
99 } 99 }
100 else 100 else
101 { 101 {