=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/fsplit/Attic/fsplit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/fsplit/Attic/fsplit.c 1996/06/26 05:33:30 1.2 +++ src/usr.bin/fsplit/Attic/fsplit.c 1998/07/10 21:44:51 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: fsplit.c,v 1.2 1996/06/26 05:33:30 deraadt Exp $ */ +/* $OpenBSD: fsplit.c,v 1.3 1998/07/10 21:44:51 mickey Exp $ */ /* * Copyright (c) 1983, 1993 @@ -44,7 +44,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)fsplit.c 8.1 (Berkeley) 6/6/93";*/ -static char rcsid[] = "$OpenBSD: fsplit.c,v 1.2 1996/06/26 05:33:30 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: fsplit.c,v 1.3 1998/07/10 21:44:51 mickey Exp $"; #endif /* not lint */ #include @@ -52,6 +52,7 @@ #include #include #include +#include /* * usage: fsplit [-e efile] ... [file] @@ -97,6 +98,7 @@ #define trim(p) while (*p == ' ' || *p == '\t') p++ +int main(argc, argv) char **argv; { @@ -131,10 +133,8 @@ if (argc > 2) badparms(); else if (argc == 2) { - if ((ifp = fopen(argv[1], "r")) == NULL) { - fprintf(stderr, "fsplit: cannot open %s\n", argv[1]); - exit(1); - } + if ((ifp = fopen(argv[1], "r")) == NULL) + err(1, argv[1]); } else ifp = stdin; @@ -159,8 +159,7 @@ for ( i = 0; i <= extrknt; i++ ) if(!extrfnd[i]) { retval = 1; - fprintf( stderr, "fsplit: %s not found\n", - extrnames[i]); + warnx("%s not found", extrnames[i]); } exit( retval ); } @@ -190,8 +189,7 @@ badparms() { - fprintf(stderr, "fsplit: usage: fsplit [-e efile] ... [file] \n"); - exit(1); + err(1, "usage: fsplit [-e efile] ... [file]"); } saveit(name) @@ -226,10 +224,8 @@ break; *ptr = '0'; } - if(ptr < name + letters) { - fprintf( stderr, "fsplit: ran out of file names\n"); - exit(1); - } + if(ptr < name + letters) + errx(1, "ran out of file names"); } } @@ -247,7 +243,7 @@ } } while (getc(ifp) != '\n' && feof(ifp) == 0) ; - fprintf(stderr, "line truncated to %d characters\n", BSZ); + warnx("line truncated to %d characters", BSZ); return (1); }