From d4bc0e05a540943c02f69b3769d405c23dc6c1b6 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Tue, 4 Oct 2022 22:04:23 +0200 Subject: [PATCH] d --- Makefile | 109 ++++++++++++++++++++++++++------------------------ a.out | Bin 0 -> 60904 bytes ft_calloc.c | 6 ++- ft_split.c | 14 ++++--- ft_strchr.c | 10 ++--- ft_striteri.c | 4 +- ft_strndup.c | 8 ++-- ft_strrchr.c | 11 ++--- ft_substr.c | 7 +++- main.c | 8 +++- 10 files changed, 96 insertions(+), 81 deletions(-) create mode 100755 a.out diff --git a/Makefile b/Makefile index 9ae7529..ed0d854 100644 --- a/Makefile +++ b/Makefile @@ -6,88 +6,93 @@ # By: cchauvet y%kHLVwcE8Vw(PclwYsa|1MtxnT^FOZEm~}YU`rJ%wQByqbMC$0eDlo=M2w;? zpECEm=bn4-Ip>~x?z!iF-8b1!x}9EQGJ#svoD_T@@QsVeB&uWpc(8k3D|{EjkC zH$2F@879k1Wr9+9bvhGMuY$XfQoVt6lOi1|!G=yXg_Kggv{!~I(W&Bt>Io`Rd3*ZK zKv_?xy4>uqM3x)2^sr(`r`CETo6XZ?z0LCy(-lfCYgDT1QI_i6tLojW>gn{b5`<2* zJV_?>Z?cl7JuN^PT?PDW81{M(S~H>91VX^C~&o(+_4>j{WgZZy%UH>*+@t|M&hUkLWh2Pr{*# z>T8vtJl$vFAK^&;zlu8vqx8A(FB>UMcg;sZUW&pS04qoV&jKtJ{;V``l0ho`^U}a? z1-tfEU=2kspJ9BU8W)j9V2A(c&u2-HoA|%K8SQ zv9h6|xeD;A6_ufy`liZ;`kTVYQa!?LiG~_0>zj<_E%ni`QPUC*8<)(THRGbtgrbS& z-GriZjnJ$G^Fr0(mT+x-BpPm6Fz=#<=BDt1$|VidTy0}>lWHy`QBxv<0~%o`{&T52 z32`9jK#A7lzV-Flq#X+sEH=2_N0`?mPnWhYdR}kuBjI-``=Q}$6x>@b%Qal*J4s=1 zk*-||F8uPLe1-_1x|Xcu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zo&MZbf1fJQDPA>6xO6=Yq`19Re)=3qr`Z}&rFQu}sp{+T*ZXvx>haRe*z5noR$re> z>GTOA&T`r7{~Be4qWjn9S2``AiD$X&^t_HTI+Iam$2{lStTym=e4W=RolE3c>g)5c zyLwpv1Jotm)&1*pvwKy2iht9k+0gy!air&T2}Re}=WCnQ2C|MSTP|H+ryf+c);Hrg zrLvOlM>nDC>AWA638wqk`|R9OiDAd5zN}Xt)qjZy%!J*7sJ_DWx*E z*hYXI_pCJa|1~J#X>k+LuGHdpw+o4p?9fiV4IZaGl8%eowjl{od{L|vpX2l1X9(&xH*S=Te d?GH@DEc3cwjo1e_sp_}=USeEht6<9-{~wk_MD+jw literal 0 HcmV?d00001 diff --git a/ft_calloc.c b/ft_calloc.c index a13cd01..1fc3cef 100644 --- a/ft_calloc.c +++ b/ft_calloc.c @@ -6,7 +6,7 @@ /* By: cchauvet 0 || s[i] == c) - { + i = ft_strlen(s) + 1; + while (i-- > 0) if (s[i] == c) - return ((char *) &s[i]); - i--; - } + return ((char *) s + i); return (NULL); } diff --git a/ft_substr.c b/ft_substr.c index 7fb9407..3f76d93 100644 --- a/ft_substr.c +++ b/ft_substr.c @@ -6,7 +6,7 @@ /* By: cchauvet = ft_strlen(s)) return (ft_strdup("")); - sub = ft_strndup(s + start, max); + sub = malloc((max + 1) * sizeof(char)); if (sub == NULL) return (NULL); + sub[max] = 0; + while (max-- > 0) + sub[max] = s[max + start]; return (sub); } diff --git a/main.c b/main.c index c652ae1..7d47969 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet