lib/libutil/gr_util.c
struct group *
gr_scan(const char *line)
{
	struct group gr;
	char *line_copy;
	struct group *new_gr;

	if ((line_copy = strdup(line)) == NULL)
		return (NULL);
	if (!__gr_scan(line_copy, &gr)) {
		free(line_copy);
		return (NULL);
	}
	new_gr = gr_dup(&gr);
	free(line_copy);
	if (gr.gr_mem != NULL)
		free(gr.gr_mem);

	return (new_gr);
}
/*
 * Create a struct group from a line.
 */
Create a struct group from a line.
Create a struct group from a line .
struct group *
gr_scan(const char *line)
{
	struct group gr;
	char *line_copy;
	struct group *new_gr;
	if ((line_copy = strdup(line)) == NULL)
		return (NULL);
	if (!__gr_scan(line_copy, &gr)) {
		free(line_copy);
		return (NULL);
	}
	new_gr = gr_dup(&gr);
	free(line_copy);
	if (gr.gr_mem != NULL)
		free(gr.gr_mem);
	return (new_gr);
}
struct group * gr_scan ( const char * line ) { struct group gr ; char * line_copy ; struct group * new_gr ; if ( ( line_copy = strdup ( line ) ) == NULL ) return ( NULL ) ; if ( ! __gr_scan ( line_copy , & gr ) ) { free ( line_copy ) ; return ( NULL ) ; } new_gr = gr_dup ( & gr ) ; free ( line_copy ) ; if ( gr . gr_mem != NULL ) free ( gr . gr_mem ) ; return ( new_gr ) ; }
Create a struct group from a line.
Create a struct group from a line .