mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
Fix two very small bugs found by running this code in valgrind.
svn path=/trunk/; revision=33041
This commit is contained in:
@@ -34,7 +34,8 @@ BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId)
|
||||
if (_stricmp(SectionName, Section->SectionName) == 0)
|
||||
{
|
||||
// We found it
|
||||
*SectionId = (ULONG)Section;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user