Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/multiboot/multiboot.c

    rc8cbd39 r9d58539  
    7171}
    7272
    73 /** Extract arguments from the multiboot module command line.
    74  *
    75  * @param buf      Destination buffer (will be always NULL-terminated).
    76  * @param size     Size of destination buffer (in bytes).
    77  * @param cmd_line Input string (the command line).
    78  *
    79  */
    80 void multiboot_extract_argument(char *buf, size_t size, const char *cmd_line)
    81 {
    82         /* Start after first space. */
    83         const char *start = str_chr(cmd_line, ' ');
    84         if (start == NULL) {
    85                 str_cpy(buf, size, "");
    86                 return;
    87         }
    88 
    89         const char *end = cmd_line + str_size(cmd_line);
    90 
    91         /* Skip the space(s). */
    92         while (start != end) {
    93                 if (start[0] == ' ')
    94                         start++;
    95                 else
    96                         break;
    97         }
    98 
    99         str_ncpy(buf, size, start, (size_t) (end - start));
    100 }
    101 
    10273static void multiboot_modules(uint32_t count, multiboot_module_t *mods)
    10374{
     
    11384                        multiboot_extract_command(init.tasks[init.cnt].name,
    11485                            CONFIG_TASK_NAME_BUFLEN, MULTIBOOT_PTR(mods[i].string));
    115                         multiboot_extract_argument(init.tasks[init.cnt].arguments,
    116                             CONFIG_TASK_ARGUMENTS_BUFLEN, MULTIBOOT_PTR(mods[i].string));
    117                 } else {
     86                } else
    11887                        init.tasks[init.cnt].name[0] = 0;
    119                         init.tasks[init.cnt].arguments[0] = 0;
    120                 }
    12188               
    12289                init.cnt++;
Note: See TracChangeset for help on using the changeset viewer.