err(1, outfile);
err(1, "%s", outfile);
main(ac, av)	int	ac;	char	*av[];{	int n;	/* revoke */	setegid(getgid());	setgid(getgid());	getargs(ac, av);	if ((inf = fopen(infile, "r")) == NULL)		err(1, infile);	count();	/*	 * allocate space for pointers.	 */	if ((CC_D.offsets = (int32_t *)calloc(CC_D.num_cards + 1,			sizeof (int32_t))) == NULL ||	    (CH_D.offsets = (int32_t *)calloc(CH_D.num_cards + 1,			sizeof (int32_t))) == NULL)		errx(1, "malloc");	fseek(inf, 0L, 0);	if ((outf = fopen(outfile, "w")) == NULL)		err(1, outfile);	fwrite(&deck[0].num_cards, sizeof(deck[0].num_cards), 1, outf);	fwrite(&deck[0].last_card, sizeof(deck[0].last_card), 1, outf);	fwrite(&deck[0].gojf_used, sizeof(deck[0].gojf_used), 1, outf);	fwrite(&deck[0].num_cards, sizeof(deck[0].num_cards), 1, outf);	fwrite(&deck[0].last_card, sizeof(deck[0].last_card), 1, outf);	fwrite(&deck[0].gojf_used, sizeof(deck[0].gojf_used), 1, outf);	fwrite(CC_D.offsets, sizeof(CC_D.offsets[0]), CC_D.num_cards, outf);	fwrite(CH_D.offsets, sizeof(CH_D.offsets[0]), CH_D.num_cards, outf);	putem();	fclose(inf);	fseek(outf, 0, 0L);	deck[0].num_cards = htons(deck[0].num_cards);	fwrite(&deck[0].num_cards, sizeof(deck[0].num_cards), 1, outf);	deck[0].last_card = htons(deck[0].last_card);	fwrite(&deck[0].last_card, sizeof(deck[0].last_card), 1, outf);	fwrite(&deck[0].gojf_used, sizeof(deck[0].gojf_used), 1, outf);	deck[0].num_cards = ntohs(deck[0].num_cards);	deck[1].num_cards = htons(deck[1].num_cards);	fwrite(&deck[1].num_cards, sizeof(deck[1].num_cards), 1, outf);	deck[1].last_card = htons(deck[1].last_card);	fwrite(&deck[1].last_card, sizeof(deck[1].last_card), 1, outf);	fwrite(&deck[1].gojf_used, sizeof(deck[1].gojf_used), 1, outf);	deck[1].num_cards = ntohs(deck[1].num_cards);	for (n = 0 ; n < CC_D.num_cards ; n++) {		CC_D.offsets[n] = htonl(CC_D.offsets[n]);		fwrite(&CC_D.offsets[n], sizeof(CC_D.offsets[n]), 1, outf);	}	for (n = 0 ; n < CH_D.num_cards ; n++) {		CH_D.offsets[n] = htonl(CH_D.offsets[n]);		fwrite(&CH_D.offsets[n], sizeof(CH_D.offsets[n]), 1, outf);	}	fclose(outf);	printf("There were %d com. chest and %d chance cards\n", CC_D.num_cards, CH_D.num_cards);	exit(0);}