Debug
authorJohn Hodge <[email protected]>
Sun, 27 Sep 2009 10:06:40 +0000 (18:06 +0800)
committerJohn Hodge <[email protected]>
Sun, 27 Sep 2009 10:06:40 +0000 (18:06 +0800)
Kernel/vfs/open.c
Usermode/Applications/CLIShell_src/main.c

index 2a3359f..d6a0fd4 100644 (file)
@@ -121,6 +121,7 @@ char *VFS_GetAbsPath(char *Path)
        
        // `ret` should now be the absolute path
        LEAVE('s', ret);
+       Log("VFS_GetAbsPath: RETURN '%s'", ret);
        return ret;
 }
 
index becbe80..8298c2a 100644 (file)
@@ -77,6 +77,11 @@ int main(int argc, char *argv[], char *envp[])
                // Read Command line\r
                sCommandStr = ReadCommandLine( &length );\r
                \r
+               if(!sCommandStr) {\r
+                       write(_stdout, 25, "PANIC: Out of heap space\n");\r
+                       return -1;\r
+               }\r
+               \r
                // Check if the command should be cached\r
                if(gasCommandHistory == NULL || strcmp(sCommandStr, gasCommandHistory[giLastCommand]) != 0)\r
                {\r
@@ -197,6 +202,12 @@ void Parse_Args(char *str, char **dest)
         int    i = 1;\r
        char    *buf = malloc( strlen(str) + 1 );\r
        \r
+       if(buf == NULL) {\r
+               dest[0] = NULL;\r
+               Print("Parse_Args: Out of heap space!\n");\r
+               return ;\r
+       }\r
+       \r
        strcpy(buf, str);\r
        dest[0] = buf;\r
        \r

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