bozo
This commit is contained in:
BIN
utils/ft_getstr.o
Normal file
BIN
utils/ft_getstr.o
Normal file
Binary file not shown.
BIN
utils/ft_is_in_quote.o
Normal file
BIN
utils/ft_is_in_quote.o
Normal file
Binary file not shown.
BIN
utils/ft_strnchr.o
Normal file
BIN
utils/ft_strnchr.o
Normal file
Binary file not shown.
BIN
utils/ft_strncpy.o
Normal file
BIN
utils/ft_strncpy.o
Normal file
Binary file not shown.
@ -1,17 +1,19 @@
|
||||
#include "utils.h"
|
||||
|
||||
char *ft_strreplace(char *str, char *fill, size_t start, size_t stop)
|
||||
int ft_strreplace(char **str, char *fill, size_t start, size_t stop)
|
||||
{
|
||||
char *out;
|
||||
size_t sum;
|
||||
|
||||
out = malloc((ft_strlen(str) + ft_strlen(fill) - (stop - start) + 1 * sizeof(char)));
|
||||
if (out == NULL)
|
||||
return (NULL);
|
||||
return (1);
|
||||
ft_strncpy(out, str, start);
|
||||
ft_strncpy(out + start, fill, ft_strlen(fill));
|
||||
sum = start + ft_strlen(fill);
|
||||
ft_strncpy(out + sum, str + stop, ft_strlen(str) - stop);
|
||||
out[sum + ft_strlen(str) - stop] = '\0';
|
||||
return (out);
|
||||
free(*str);
|
||||
*str = out;
|
||||
return (0);
|
||||
}
|
||||
|
BIN
utils/ft_strreplace.o
Normal file
BIN
utils/ft_strreplace.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user