aboutsummaryrefslogtreecommitdiff
path: root/src/str
diff options
context:
space:
mode:
Diffstat (limited to 'src/str')
-rw-r--r--src/str/ft_atoi_strict.c2
-rw-r--r--src/str/ft_strcpy.c2
-rw-r--r--src/str/ft_strlen.c2
-rw-r--r--src/str/ft_strncpy.c4
-rw-r--r--src/str/ft_strrchr.c2
-rw-r--r--src/str/ft_strtol.c12
6 files changed, 12 insertions, 12 deletions
diff --git a/src/str/ft_atoi_strict.c b/src/str/ft_atoi_strict.c
index f12e8db..f573593 100644
--- a/src/str/ft_atoi_strict.c
+++ b/src/str/ft_atoi_strict.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/15 10:06:29 by cacharle #+# #+# */
-/* Updated: 2020/01/18 11:53:07 by cacharle ### ########.fr */
+/* Updated: 2020/02/10 02:20:40 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/str/ft_strcpy.c b/src/str/ft_strcpy.c
index 9677b24..ee6ff0d 100644
--- a/src/str/ft_strcpy.c
+++ b/src/str/ft_strcpy.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:38:36 by cacharle #+# #+# */
-/* Updated: 2019/11/20 23:25:57 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 11:36:19 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/str/ft_strlen.c b/src/str/ft_strlen.c
index 0e0a47c..0d593e1 100644
--- a/src/str/ft_strlen.c
+++ b/src/str/ft_strlen.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:32:48 by cacharle #+# #+# */
-/* Updated: 2019/11/21 01:45:42 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 11:13:43 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/str/ft_strncpy.c b/src/str/ft_strncpy.c
index a0cfb4c..07a4927 100644
--- a/src/str/ft_strncpy.c
+++ b/src/str/ft_strncpy.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:26:59 by cacharle #+# #+# */
-/* Updated: 2019/11/21 02:49:48 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 10:40:21 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,7 +17,7 @@ char *ft_strncpy(char *dest, const char *src, size_t n)
size_t len;
len = ft_strlen(src);
- ft_memcpy(dest, src, MIN(n, len));
+ ft_memcpy(dest, src, n < len ? n : len);
if (len < n)
ft_bzero(dest + len, n - len);
return (dest);
diff --git a/src/str/ft_strrchr.c b/src/str/ft_strrchr.c
index 56c8be5..4cedb76 100644
--- a/src/str/ft_strrchr.c
+++ b/src/str/ft_strrchr.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:26:24 by cacharle #+# #+# */
-/* Updated: 2019/11/20 03:36:47 by cacharle ### ########.fr */
+/* Updated: 2019/11/21 18:46:27 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/str/ft_strtol.c b/src/str/ft_strtol.c
index 7fab7ed..82276d8 100644
--- a/src/str/ft_strtol.c
+++ b/src/str/ft_strtol.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/15 10:26:45 by cacharle #+# #+# */
-/* Updated: 2020/01/18 11:52:22 by cacharle ### ########.fr */
+/* Updated: 2020/02/10 02:21:16 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,7 @@
#define STRTOL_STD_BASE "0123456789abcdefghijklmnopqrstuvwxyz"
-static int strtol_handle_base(int base, const char **str)
+static int st_strtol_handle_base(int base, const char **str)
{
if (base > 36)
return (-1);
@@ -39,7 +39,7 @@ static int strtol_handle_base(int base, const char **str)
return (10);
}
-static long errno_return(int err)
+static long st_errno_return(int err)
{
errno = err;
return (0);
@@ -53,7 +53,7 @@ static long errno_return(int err)
long ft_strtol(const char *str, char **endptr, int base)
{
- t_bool is_negative;
+ t_ftbool is_negative;
long long nb;
char base_str[37];
@@ -62,8 +62,8 @@ long ft_strtol(const char *str, char **endptr, int base)
is_negative = *str == '-' ? TRUE : FALSE;
if (*str == '-' || *str == '+')
str++;
- if ((base = strtol_handle_base(base, &str)) == -1)
- return (errno_return(EINVAL));
+ if ((base = st_strtol_handle_base(base, &str)) == -1)
+ return (st_errno_return(EINVAL));
ft_strncpy(base_str, STRTOL_STD_BASE, base);
base_str[base] = '\0';
nb = 0;