Fixed bug in kernel script parsing (uninitialised value)
authorJohn Hodge <[email protected]>
Wed, 2 Mar 2011 05:03:31 +0000 (13:03 +0800)
committerJohn Hodge <[email protected]>
Wed, 2 Mar 2011 05:03:31 +0000 (13:03 +0800)
Kernel/system.c

index 8b457b4..a996038 100644 (file)
@@ -548,6 +548,7 @@ tConfigFile *System_Int_ParseFile(char *FileData)
                start = ptr;
                
                ret->Lines[i].nParts = 0;
+               ret->Lines[i].Parts = NULL;
                
                // Count parts
                for(;;)
@@ -640,6 +641,12 @@ tConfigFile        *System_Int_ParseFile(char *FileData)
                }
        }
        
+       if( i < ret->nLines ) {
+               ret->Lines[i].nParts = 0;
+               ret->Lines[i].Parts = NULL;
+               Log_Log("System", "Cleaning up final empty line");
+       }
+       
        LEAVE('p', ret);
        return ret;
 }

UCC git Repository :: git.ucc.asn.au