mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:32:56 +00:00
[USETUP]: Do not append an extra NULL-terminator when updating freeldr.ini
svn path=/trunk/; revision=70558
This commit is contained in:
parent
119229c8fb
commit
6ed0a4c6b2
1 changed files with 5 additions and 6 deletions
|
@ -537,7 +537,7 @@ IniCacheLoad(
|
||||||
|
|
||||||
DPRINT("File size: %lu\n", FileLength);
|
DPRINT("File size: %lu\n", FileLength);
|
||||||
|
|
||||||
/* Allocate file buffer */
|
/* Allocate file buffer with NULL-terminator */
|
||||||
FileBuffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
|
FileBuffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
|
||||||
0,
|
0,
|
||||||
FileLength + 1);
|
FileLength + 1);
|
||||||
|
@ -560,7 +560,7 @@ IniCacheLoad(
|
||||||
&FileOffset,
|
&FileOffset,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* Append string terminator */
|
/* Append NULL-terminator */
|
||||||
FileBuffer[FileLength] = 0;
|
FileBuffer[FileLength] = 0;
|
||||||
|
|
||||||
NtClose(FileHandle);
|
NtClose(FileHandle);
|
||||||
|
@ -971,16 +971,15 @@ IniCacheSave(
|
||||||
|
|
||||||
Section = Section->Next;
|
Section = Section->Next;
|
||||||
if (Section != NULL)
|
if (Section != NULL)
|
||||||
BufferSize += 2; /* extra "\r\n" at end of each section */
|
BufferSize += 2; /* Extra "\r\n" at end of each section */
|
||||||
}
|
}
|
||||||
BufferSize++; /* Null-terminator */
|
|
||||||
|
|
||||||
DPRINT("BufferSize: %lu\n", BufferSize);
|
DPRINT("BufferSize: %lu\n", BufferSize);
|
||||||
|
|
||||||
/* Allocate file buffer */
|
/* Allocate file buffer with NULL-terminator */
|
||||||
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
|
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
BufferSize);
|
BufferSize + 1);
|
||||||
if (Buffer == NULL)
|
if (Buffer == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("RtlAllocateHeap() failed\n");
|
DPRINT1("RtlAllocateHeap() failed\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue