Changeset 61f8d668 in rtems


Ignore:
Timestamp:
Nov 19, 2014, 8:26:11 PM (5 years ago)
Author:
Josh Oguin <josh.oguin@…>
Branches:
4.11, master
Children:
0ad1e80
Parents:
ba3b6fd
git-author:
Josh Oguin <josh.oguin@…> (11/19/14 20:26:11)
git-committer:
Joel Sherrill <joel.sherrill@…> (11/26/14 13:51:57)
Message:

libbsp/shared/bspinit.c: Document assumption of NULL returned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/bspinit.c

    rba3b6fd r61f8d668  
    3838  int         result = -124;
    3939
    40   if (boot_cmdline)
    41   {
     40  if (boot_cmdline) {
    4241    cmdline = malloc (strlen (boot_cmdline) + 1);
    4342
    44     if (cmdline)
    45     {
     43    if (cmdline) {
    4644      strcpy (cmdline, boot_cmdline);
    4745
     
    5149       * Break the line up into arguments with "" being ignored.
    5250       */
    53       while (true)
    54       {
     51      while (true) {
    5552        command = strtok (command, " \t\r\n");
    5653        if (command == NULL)
     
    6057      }
    6158
     59      /*
     60       * If there are arguments, allocate enough memory for the argv
     61       * array to be passed into main().
     62       *
     63       * NOTE: If argc is 0, then argv will be NULL.
     64       */
    6265      argv = calloc (argc, sizeof (char*));
    6366
    64       if (argv)
    65       {
     67      if (argv) {
    6668        int a;
    6769
     
    6971        argv[0] = command;
    7072
    71         for (a = 1; a < argc; a++)
    72         {
     73        for (a = 1; a < argc; a++) {
    7374          command += strlen (command) + 1;
    7475          argv[a] = command;
    7576        }
    76       }
    77       else
     77      } else
    7878        argc = 0;
    7979    }
Note: See TracChangeset for help on using the changeset viewer.