(void) strcpy(Outfile, Infile); (void) strcat(Outfile, ".dat");
(void) strlcpy(Outfile, Infile, sizeof(Outfile)); if (strlcat(Outfile, ".dat", sizeof(Outfile)) >= MAXPATHLEN) errx(1, "`%s': name too long", Infile);
getargs(argc, argv)int	argc;char	**argv;{	extern char	*optarg;	extern int	optind;	int	ch;	while ((ch = getopt(argc, argv, "c:iorsx")) != -1)		switch(ch) {		case 'c':			/* new delimiting char */			Delimch = *optarg;			if (!isascii(Delimch)) {				printf("bad delimiting character: '\\%o\n'",				       Delimch);			}			break;		case 'i':			/* ignore case in ordering */			Iflag++;			break;		case 'o':			/* order strings */			Oflag++;			break;		case 'r':			/* randomize pointers */			Rflag++;			break;		case 's':			/* silent */			Sflag++;			break;		case 'x':			/* set the rotated bit */			Xflag++;			break;		case '?':		default:			usage();		}	argv += optind;	if (*argv) {		Infile = *argv;		if (*++argv)			(void) strcpy(Outfile, *argv);	}	if (!Infile) {		puts("No input file name");		usage();	}	if (*Outfile == '\0') {		(void) strcpy(Outfile, Infile);		(void) strcat(Outfile, ".dat");	}}