platform/unix.c
changeset 316 29a4d12d1dc6
parent 310 f8bca4a93fd5
child 327 76e207c6b4a7
equal deleted inserted replaced
315:b209dfe09e57 316:29a4d12d1dc6
    89 
    89 
    90         /* add other mount types here */
    90         /* add other mount types here */
    91 
    91 
    92         if (add_it)
    92         if (add_it)
    93         {
    93         {
    94             char **tmp = realloc(retval, sizeof (char *) * cd_count + 1);
    94             char **tmp = realloc(retval, sizeof (char *) * (cd_count + 1));
    95             if (tmp)
    95             if (tmp)
    96             {
    96             {
    97                 retval = tmp;
    97                 retval = tmp;
    98                 retval[cd_count-1] = (char *)
    98                 retval[cd_count - 1] = (char *)
    99                                 malloc(strlen(mntbufp[ ii ].f_mntonname) + 1);
    99                                 malloc(strlen(mntbufp[ii].f_mntonname) + 1);
   100                 if (retval[cd_count-1])
   100                 if (retval[cd_count - 1])
   101                 {
   101                 {
   102                     strcpy(retval[cd_count-1], mntbufp[ ii ].f_mntonname);
   102                     strcpy(retval[cd_count - 1], mntbufp[ii].f_mntonname);
   103                     cd_count++;
   103                     cd_count++;
   104                 } /* if */
   104                 } /* if */
   105             } /* if */
   105             } /* if */
   106         } /* if */
   106         } /* if */
   107     }
   107     }
   135 
   135 
   136         /* add other mount types here */
   136         /* add other mount types here */
   137 
   137 
   138         if (add_it)
   138         if (add_it)
   139         {
   139         {
   140             char **tmp = realloc(retval, sizeof (char *) * cd_count + 1);
   140             char **tmp = realloc(retval, sizeof (char *) * (cd_count + 1));
   141             if (tmp)
   141             if (tmp)
   142             {
   142             {
   143                 retval = tmp;
   143                 retval = tmp;
   144                 retval[cd_count-1] = (char *) malloc(strlen(ent->mnt_dir) + 1);
   144                 retval[cd_count-1] = (char *) malloc(strlen(ent->mnt_dir) + 1);
   145                 if (retval[cd_count-1])
   145                 if (retval[cd_count - 1])
   146                 {
   146                 {
   147                     strcpy(retval[cd_count-1], ent->mnt_dir);
   147                     strcpy(retval[cd_count - 1], ent->mnt_dir);
   148                     cd_count++;
   148                     cd_count++;
   149                 } /* if */
   149                 } /* if */
   150             } /* if */
   150             } /* if */
   151         } /* if */
   151         } /* if */
   152     } /* while */
   152     } /* while */