err(1, x);
err(1, "%s", x);
main(argc, argv)	char  **argv;{	register FILE *ofp;	/* output file */	register int rv;	/* 1 if got card in output file, 0 otherwise */	register char *ptr;	int     nflag,		/* 1 if got name of subprog., 0 otherwise */	        retval, i;	/* must be as large as max(sizeof(x), sizeof(mainp), sizeof(blockp)) */	char    name[20];		maxextrknt = 100;	extrnames = malloc(sizeof(char *) * maxextrknt);	if (extrnames == NULL)		errx(1, "out of memory");	/* scan -e options */	while (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e') {		extr = TRUE;		ptr = argv[1] + 2;		if (!*ptr) {			argc--;			argv++;			if (argc <= 1)				badparms();			ptr = argv[1];		}		extrknt = extrknt + 1;		if (extrknt >= maxextrknt) {			extrnames = realloc(extrnames, 			    sizeof(char *) * maxextrknt);			if (extrnames == NULL)				errx(1, "too many -e arguments");		}		if ((extrnames[extrknt] = strdup(ptr)) == NULL)			errx(1, "out of memory");		argc--;		argv++;	}	extrfnd = calloc(extrknt+1, sizeof(int));	if (extrfnd == NULL)		errx(1, "out of memory");	if (argc > 2)		badparms();	else		if (argc == 2) {			if ((ifp = fopen(argv[1], "r")) == NULL)				err(1, "%s", argv[1]);		} else			ifp = stdin;	for (;;) {		int fd;		/* look for a temp file that doesn't correspond to an existing		 * file */		get_name(x, 3);		fd = open(x, O_CREAT|O_EXCL|O_RDWR, 0666);		if (fd == -1)			err(1, x);		ofp = fdopen(fd, "w");		if (ofp == NULL) {			close(fd);			unlink(x);			err(1, x);		}		nflag = 0;		rv = 0;		while (getline() > 0) {			rv = 1;			fprintf(ofp, "%s", buf);			if (lend())	/* look for an 'end' statement */				break;			if (nflag == 0)	/* if no name yet, try and find one */				nflag = lname(name);		}		fclose(ofp);		if (rv == 0) {	/* no lines in file, forget the file */			unlink(x);			retval = 0;			for (i = 0; i <= extrknt; i++)				if (!extrfnd[i]) {					retval = 1;					warnx("%s not found", extrnames[i]);				}			exit(retval);		}		if (nflag) {	/* rename the file */			if (saveit(name)) {				if (stat(name, &sbuf) < 0) {					link(x, name);					unlink(x);					printf("%s\n", name);					continue;				} else					if (strcmp(name, x) == 0) {						printf("%s\n", x);						continue;					}				printf("%s already exists, put in %s\n", name, x);				continue;			} else				unlink(x);			continue;		}		if (!extr)			printf("%s\n", x);		else			unlink(x);	}}