diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-14 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-15 23:55:04 +0500 |
| commit | fc662341e6f85da78ada0e443f6116b978f79f22 (patch) | |
| tree | 1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /CPP/Common/ListFileUtils.cpp | |
| parent | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff) | |
| download | 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.gz 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.bz2 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.zip | |
24.0524.05
Diffstat (limited to 'CPP/Common/ListFileUtils.cpp')
| -rw-r--r-- | CPP/Common/ListFileUtils.cpp | 14 |
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 | { |
