platform/unix.c
changeset 316 29a4d12d1dc6
parent 310 f8bca4a93fd5
child 327 76e207c6b4a7
--- a/platform/unix.c	Sat Jun 29 22:25:10 2002 +0000
+++ b/platform/unix.c	Sat Jun 29 22:25:57 2002 +0000
@@ -91,15 +91,15 @@
 
         if (add_it)
         {
-            char **tmp = realloc(retval, sizeof (char *) * cd_count + 1);
+            char **tmp = realloc(retval, sizeof (char *) * (cd_count + 1));
             if (tmp)
             {
                 retval = tmp;
-                retval[cd_count-1] = (char *)
-                                malloc(strlen(mntbufp[ ii ].f_mntonname) + 1);
-                if (retval[cd_count-1])
+                retval[cd_count - 1] = (char *)
+                                malloc(strlen(mntbufp[ii].f_mntonname) + 1);
+                if (retval[cd_count - 1])
                 {
-                    strcpy(retval[cd_count-1], mntbufp[ ii ].f_mntonname);
+                    strcpy(retval[cd_count - 1], mntbufp[ii].f_mntonname);
                     cd_count++;
                 } /* if */
             } /* if */
@@ -137,14 +137,14 @@
 
         if (add_it)
         {
-            char **tmp = realloc(retval, sizeof (char *) * cd_count + 1);
+            char **tmp = realloc(retval, sizeof (char *) * (cd_count + 1));
             if (tmp)
             {
                 retval = tmp;
                 retval[cd_count-1] = (char *) malloc(strlen(ent->mnt_dir) + 1);
-                if (retval[cd_count-1])
+                if (retval[cd_count - 1])
                 {
-                    strcpy(retval[cd_count-1], ent->mnt_dir);
+                    strcpy(retval[cd_count - 1], ent->mnt_dir);
                     cd_count++;
                 } /* if */
             } /* if */