3BSD/usr/src/cmd/sdb/mktemp.c

Compare this file to the similar file:
Show the results in this format:

/* make temporary file with given prefix. */
char *
mktemp(as)
char *as;
{
	register char *s;
	register unsigned pid;

	pid = getpid();
	s = as;
	while (*s++)
		;
	s--;
	while (*--s == 'X') {
		*s = (pid%10) + '0';
		pid /= 10;
	}
	s++;
	*s = 'a';
	return(as);
}