=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/size/Attic/size.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/size/Attic/size.c 1999/05/10 16:14:07 1.11 --- src/usr.bin/size/Attic/size.c 2001/05/31 16:26:59 1.12 *************** *** 1,4 **** ! /* $OpenBSD: size.c,v 1.11 1999/05/10 16:14:07 espie Exp $ */ /* $NetBSD: size.c,v 1.7 1996/01/14 23:07:12 pk Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: size.c,v 1.12 2001/05/31 16:26:59 smart Exp $ */ /* $NetBSD: size.c,v 1.7 1996/01/14 23:07:12 pk Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)size.c 8.2 (Berkeley) 12/9/93"; #endif ! static char rcsid[] = "$OpenBSD: size.c,v 1.11 1999/05/10 16:14:07 espie Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)size.c 8.2 (Berkeley) 12/9/93"; #endif ! static char rcsid[] = "$OpenBSD: size.c,v 1.12 2001/05/31 16:26:59 smart Exp $"; #endif /* not lint */ #include *************** *** 72,80 **** int process_file __P((int, char *)); int show_archive __P((int, char *, FILE *)); int show_objfile __P((int, char *, FILE *)); - int show_object __P((int, char *, FILE *)); - void *emalloc __P((size_t)); - void *erealloc __P((void *, size_t)); void usage __P((void)); int --- 72,77 ---- *************** *** 179,185 **** baselen = strlen(fname) + 3; namelen = sizeof(ar_head.ar_name); ! name = emalloc(baselen + namelen); rval = 0; --- 176,183 ---- baselen = strlen(fname) + 3; namelen = sizeof(ar_head.ar_name); ! if ((name = malloc(baselen + namelen)) == NULL) ! err(1, NULL); rval = 0; *************** *** 220,234 **** int len = atoi(&ar_head.ar_name[3]); if (len > namelen) { p -= (long)name; ! name = (char *)erealloc(name, baselen+len); namelen = len; p += (long)name; } if (fread(p, len, 1, fp) != 1) { ! (void)fprintf(stderr, ! "nm: %s: premature EOF.\n", name); (void)free(name); ! return 1; } p += len; } else --- 218,232 ---- int len = atoi(&ar_head.ar_name[3]); if (len > namelen) { p -= (long)name; ! if ((name = realloc(name, baselen+len)) == NULL) ! err(1, NULL); namelen = len; p += (long)name; } if (fread(p, len, 1, fp) != 1) { ! warnx("%s: premature EOF", name); (void)free(name); ! return(1); } p += len; } else *************** *** 312,340 **** (void)printf("\n"); return (0); - } - - void * - emalloc(size) - size_t size; - { - char *p; - - /* NOSTRICT */ - if ((p = malloc(size))) - return(p); - err(1, NULL); - } - - void * - erealloc(p, size) - void *p; - size_t size; - { - /* NOSTRICT */ - if ((p = realloc(p, size))) - return(p); - err(1, NULL); } void --- 310,315 ----