Don't cast returns from malloc()
[openafs.git] / src / export / cfgexport.c
index 1268f2f..762b7eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -51,8 +51,8 @@ main(argc, argv)
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -202,7 +202,7 @@ get_syms(conf, syms)
 
     if (syms == NULL)
       sys_error("syms is NULL");
-    fp = fopen(syms, "r"); 
+    fp = fopen(syms, "r");
     if (fp == NULL)
        sys_error(syms);
 
@@ -232,7 +232,7 @@ get_syms(conf, syms)
     if (debug)
        printf("nsyms = %d\n", nsyms);
 
-    x_symtab = (struct syment *)malloc(nsyms * SYMESZ);
+    x_symtab = malloc(nsyms * SYMESZ);
     if (!x_symtab)
        error("no memory for symbol table");
 
@@ -326,7 +326,7 @@ get_syms(conf, syms)
     /*
      * we will need no more than `nxsyms' symbols.
      */
-    k_symtab = (sym_t *) malloc(nxsyms * sizeof(sym_t));
+    k_symtab = malloc(nxsyms * sizeof(sym_t));
     if (!k_symtab)
        error("no memory for EXPORT symbol table");
 
@@ -459,7 +459,7 @@ xlate_xtok(xp, kp, strp, szp)
         */
        len = strlen(xp->n_nptr) + 1;
        while (len >= left) {
-           export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
+           export_strings = realloc(*strp, sz += SYMBUFSIZE);
            if (!export_strings)
                error("no memory for EXPORT string table");
            *strp = export_strings;
@@ -481,7 +481,7 @@ xlate_xtok(xp, kp, strp, szp)
     if (debug)
        dump_ksym(kp, *strp);
 }
-\f
+
 /*
  * find_suffix -       look for a string that arg string is suffix of
  *
@@ -533,7 +533,7 @@ find_suffix(p, strings, max, offp)
 
     return 0;
 }
-\f
+
 /*
  * xsym_compar -       compare two XCOFF symbol table entries
  *
@@ -564,7 +564,7 @@ xsym_compar(xp, xq)
 
     return compar;
 }
-\f
+
 /*
  * dump_xsym - print to XCOFF symbol
  */