Fix rsync 42 / 21 and improve name of ft_ltoa_base_len

This commit is contained in:
gbaconni
2022-04-18 09:14:59 +02:00
parent 0cd1d2ef1b
commit 505f5d9912
9 changed files with 28 additions and 83 deletions

13
libftprintf/.gitignore vendored Normal file
View File

@@ -0,0 +1,13 @@
*.a
*.o
*.out
*.so
*.dSYM/
.*.swp
.*.git
*~
t
t?
build
.vscode
.DS_Store/

View File

@@ -6,13 +6,13 @@
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/16 13:51:16 by gbaconni #+# #+# */
/* Updated: 2022/04/16 00:46:32 by gbaconni ### lausanne.ch */
/* Updated: 2022/04/18 09:13:04 by gbaconni ### lausanne.ch */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
static long ft_longlen_base(long n, long nbase);
static long ft_ltoa_base_len(long n, long nbase);
char *ft_ltoa_base(long n, char *base)
{
@@ -22,7 +22,7 @@ char *ft_ltoa_base(long n, char *base)
long nbase;
nbase = ft_strlen(base);
s = (char *) ft_calloc((ft_longlen_base(n, nbase) + 1), sizeof(char));
s = (char *) ft_calloc(ft_ltoa_base_len(n, nbase) + 1, sizeof(char));
if (s == NULL)
return (NULL);
i = 0;
@@ -42,7 +42,7 @@ char *ft_ltoa_base(long n, char *base)
return (ft_strrev(s));
}
static long ft_longlen_base(long n, long nbase)
static long ft_ltoa_base_len(long n, long nbase)
{
size_t len;

View File

@@ -6,7 +6,7 @@
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:43:52 by gbaconni #+# #+# */
/* Updated: 2022/04/17 22:45:28 by gbaconni ### lausanne.ch */
/* Updated: 2022/04/18 09:01:19 by gbaconni ### lausanne.ch */
/* */
/* ************************************************************************** */