aboutsummaryrefslogtreecommitdiff
path: root/src/str
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-17 10:56:16 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-17 10:56:16 +0100
commitfe37597119353ce183fc404417b81bd4702f64b7 (patch)
treefaa20a8352092c062e2fd272fff2104d9f2ddb3f /src/str
parent2e5ca2ab6276b7b24895ade28e1533356ef523dc (diff)
downloadlibft-fe37597119353ce183fc404417b81bd4702f64b7.tar.gz
libft-fe37597119353ce183fc404417b81bd4702f64b7.tar.bz2
libft-fe37597119353ce183fc404417b81bd4702f64b7.zip
Splited include like src/, Adding feature toggle protection in header
Diffstat (limited to 'src/str')
-rw-r--r--src/str/ft_atoi_strict.c3
-rw-r--r--src/str/ft_strncpy.c4
-rw-r--r--src/str/ft_strtol.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/src/str/ft_atoi_strict.c b/src/str/ft_atoi_strict.c
index 6156b03..0079807 100644
--- a/src/str/ft_atoi_strict.c
+++ b/src/str/ft_atoi_strict.c
@@ -6,13 +6,12 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/15 10:06:29 by cacharle #+# #+# */
-/* Updated: 2020/01/15 14:09:03 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 10:12:54 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
-#include <stdio.h>
int ft_strict_atoi(const char *s)
{
char *end;
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_strtol.c b/src/str/ft_strtol.c
index 0fb5261..e5ce552 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/15 14:15:40 by cacharle ### ########.fr */
+/* Updated: 2020/01/17 10:54:41 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -51,7 +51,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];