Author: hbelusca
Date: Sat Jan 9 11:39:56 2016
New Revision: 70558
URL:
http://svn.reactos.org/svn/reactos?rev=70558&view=rev
Log:
[USETUP]: Do not append an extra NULL-terminator when updating freeldr.ini
Modified:
trunk/reactos/base/setup/usetup/inicache.c
Modified: trunk/reactos/base/setup/usetup/inicache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inicache…
==============================================================================
--- trunk/reactos/base/setup/usetup/inicache.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/inicache.c [iso-8859-1] Sat Jan 9 11:39:56 2016
@@ -537,7 +537,7 @@
DPRINT("File size: %lu\n", FileLength);
- /* Allocate file buffer */
+ /* Allocate file buffer with NULL-terminator */
FileBuffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
0,
FileLength + 1);
@@ -560,7 +560,7 @@
&FileOffset,
NULL);
- /* Append string terminator */
+ /* Append NULL-terminator */
FileBuffer[FileLength] = 0;
NtClose(FileHandle);
@@ -971,16 +971,15 @@
Section = Section->Next;
if (Section != NULL)
- BufferSize += 2; /* extra "\r\n" at end of each section */
- }
- BufferSize++; /* Null-terminator */
+ BufferSize += 2; /* Extra "\r\n" at end of each section */
+ }
DPRINT("BufferSize: %lu\n", BufferSize);
- /* Allocate file buffer */
+ /* Allocate file buffer with NULL-terminator */
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
HEAP_ZERO_MEMORY,
- BufferSize);
+ BufferSize + 1);
if (Buffer == NULL)
{
DPRINT1("RtlAllocateHeap() failed\n");