cleanup.c
int string_switch(char **prev, char **tmp)
{
	free(*prev);
	*prev = _strdup(*tmp);
	if (!*prev)
		return (1);
	return (0);
}
/**
 * string_switch - frees a string and replaces it with another
 * @prev: address of string to replace
 * @tmp: address of string to place into prev address
 * Return: 0 on success, 1 on failure
 */
frees a string and replaces it with another
@prev: address of string to replace
@tmp: address of string to place into prev address
Return: 0 on success, 1 on failure
frees a string and replaces it with another @prev : address of string to replace @tmp : address of string to place into prev address Return : 0 on success 1 on failure
int string_switch(char **prev, char **tmp)
{
	free(*prev);
	*prev = _strdup(*tmp);
	if (!*prev)
		return (1);
	return (0);
}
int string_switch ( char * * prev , char * * tmp ) { free ( * prev ) ; * prev = _strdup ( * tmp ) ; if ( ! * prev ) return ( 1 ) ; return ( 0 ) ; }
string_switch - frees a string and replaces it with another
 @prev: address of string to replace
 @tmp: address of string to place into prev address
 Return: 0 on success, 1 on failure
string_switch - frees a string and replaces it with another @prev : address of string to replace @tmp : address of string to place into prev address Return : 0 on success 1 on failure