Commit ce30db50 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Avoid using memrchrW().

parent 68587234
......@@ -418,8 +418,8 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
if (*szLineStart == '[') /* section start */
{
const WCHAR * szSectionEnd;
if (!(szSectionEnd = memrchrW( szLineStart, ']', szLineEnd - szLineStart )))
for (len = szLineEnd - szLineStart; len > 0; len--) if (szLineStart[len - 1] == ']') break;
if (!len)
{
WARN("Invalid section header at line %d: %s\n",
line, debugstr_wn(szLineStart, (int)(szLineEnd - szLineStart)) );
......@@ -427,7 +427,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
else
{
szLineStart++;
len = (int)(szSectionEnd - szLineStart);
len -= 2;
/* no need to allocate +1 for NULL terminating character as
* already included in structure */
if (!(section = HeapAlloc( GetProcessHeap(), 0, sizeof(*section) + len * sizeof(WCHAR) )))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment