mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
Fix two very small bugs found by running this code in valgrind.
svn path=/trunk/; revision=33041
This commit is contained in:
parent
436e9bc3ec
commit
8a990e7dd6
|
@ -34,6 +34,7 @@ BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId)
|
|||
if (_stricmp(SectionName, Section->SectionName) == 0)
|
||||
{
|
||||
// We found it
|
||||
if (SectionId)
|
||||
*SectionId = (ULONG)Section;
|
||||
DbgPrint((DPRINT_INIFILE, "IniOpenSection() Found it! SectionId = 0x%x\n", SectionId));
|
||||
return TRUE;
|
||||
|
|
|
@ -232,9 +232,9 @@ ULONG IniGetNextLine(PCHAR IniFileData, ULONG IniFileSize, PCHAR Buffer, ULONG B
|
|||
Buffer[Idx] = '\0';
|
||||
|
||||
// Get rid of newline & linefeed characters (if any)
|
||||
if((Buffer[strlen(Buffer)-1] == '\n') || (Buffer[strlen(Buffer)-1] == '\r'))
|
||||
if(strlen(Buffer) && ((Buffer[strlen(Buffer)-1] == '\n') || (Buffer[strlen(Buffer)-1] == '\r')))
|
||||
Buffer[strlen(Buffer)-1] = '\0';
|
||||
if((Buffer[strlen(Buffer)-1] == '\n') || (Buffer[strlen(Buffer)-1] == '\r'))
|
||||
if(strlen(Buffer) && ((Buffer[strlen(Buffer)-1] == '\n') || (Buffer[strlen(Buffer)-1] == '\r')))
|
||||
Buffer[strlen(Buffer)-1] = '\0';
|
||||
|
||||
// Send back new offset
|
||||
|
|
Loading…
Reference in a new issue