want to alloc sizeof(char), NOT sizeof(char *)
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 May 1983 05:41:33 +0000 (21:41 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Sun, 15 May 1983 05:41:33 +0000 (21:41 -0800)
SCCS-vsn: sbin/restore/symtab.c 3.11

usr/src/sbin/restore/symtab.c

index 7e19c68..6ec5805 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (c) 1983 Regents of the University of California */
 
 #ifndef lint
 /* Copyright (c) 1983 Regents of the University of California */
 
 #ifndef lint
-static char sccsid[] = "@(#)symtab.c   3.10    (Berkeley)      83/05/03";
+static char sccsid[] = "@(#)symtab.c   3.11    (Berkeley)      83/05/14";
 #endif
 
 /*
 #endif
 
 /*
@@ -504,7 +504,7 @@ initsymtable(filename)
                panic("cannot stat symbol table file %s\n", filename);
        }
        tblsize = stbuf.st_size - sizeof(struct symtableheader);
                panic("cannot stat symbol table file %s\n", filename);
        }
        tblsize = stbuf.st_size - sizeof(struct symtableheader);
-       base = calloc(sizeof(char *), (unsigned)tblsize);
+       base = calloc(sizeof(char), (unsigned)tblsize);
        if (base == NULL)
                panic("cannot allocate space for symbol table\n");
        if (read(fd, base, (int)tblsize) < 0 ||
        if (base == NULL)
                panic("cannot allocate space for symbol table\n");
        if (read(fd, base, (int)tblsize) < 0 ||