Commit 87847b47 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

kernel32: Don't try to load an empty initialization file.

parent 7c3529f1
......@@ -322,7 +322,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
TRACE("%p\n", hFile);
dwFileSize = GetFileSize(hFile, NULL);
if (dwFileSize == INVALID_FILE_SIZE)
if (dwFileSize == INVALID_FILE_SIZE || dwFileSize == 0)
return NULL;
buffer_base = HeapAlloc(GetProcessHeap(), 0 , dwFileSize);
......
......@@ -865,10 +865,7 @@ static void test_WritePrivateProfileString(void)
"key=string\r\n";
ret = WritePrivateProfileStringA("", "key", "string", path);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
todo_wine
{
ok(check_file_data(path, data), "File doesn't match\n");
}
ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path);
/* NULL lpKeyName */
......
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