usr.bin/xinstall/xinstall.c
int
create_tempfile(const char *path, char *temp, size_t tsize)
{
	char *p;

	strncpy(temp, path, tsize);
	temp[tsize - 1] = '\0';
	if ((p = strrchr(temp, '/')) != NULL)
		p++;
	else
		p = temp;
	strncpy(p, "INS@XXXX", &temp[tsize - 1] - p);
	temp[tsize - 1] = '\0';
	return (mkstemp(temp));
}
/*
 * create_tempfile --
 *	create a temporary file based on path and open it
 */
create_tempfile
create a temporary file based on path and open it
create_tempfile create a temporary file based on path and open it
int
create_tempfile(const char *path, char *temp, size_t tsize)
{
	char *p;
	strncpy(temp, path, tsize);
	temp[tsize - 1] = '\0';
	if ((p = strrchr(temp, '/')) != NULL)
		p++;
	else
		p = temp;
	strncpy(p, "INS@XXXX", &temp[tsize - 1] - p);
	temp[tsize - 1] = '\0';
	return (mkstemp(temp));
}
int create_tempfile ( const char * path , char * temp , size_t tsize ) { char * p ; strncpy ( temp , path , tsize ) ; temp [ tsize - 1 ] = ' \0 ' ; if ( ( p = strrchr ( temp , ' ' ) ) != NULL ) p ++ ; else p = temp ; strncpy ( p , " " , & temp [ tsize - 1 ] - p ) ; temp [ tsize - 1 ] = ' \0 ' ; return ( mkstemp ( temp ) ) ; }
create_tempfile
      create a temporary file based on path and open it
create_tempfile create a temporary file based on path and open it