Skip to content

Commit 3af2f48

Browse files
committed
Fix buffer size check
1 parent c5e89b0 commit 3af2f48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Common/stringhelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ namespace StringHelper
229229
return std::wstring();
230230
}
231231

232-
if (count < sizeof(buf))
232+
if (count < _countof(buf))
233233
{
234234
// All characters have been written to the small buffer.
235235
return std::wstring(buf, count);
@@ -267,7 +267,7 @@ namespace StringHelper
267267
return std::wstring();
268268
}
269269

270-
if (count < sizeof(buf))
270+
if (count < _countof(buf))
271271
{
272272
// All characters have been written to the small buffer.
273273
return std::wstring(buf, count);

0 commit comments

Comments
 (0)