aboutsummaryrefslogtreecommitdiff
path: root/convert_str.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-11-10 10:37:51 +0100
committerCharles <sircharlesaze@gmail.com>2019-11-13 09:00:43 +0100
commit3f2ef05278d42233f0a9ee9652e152824a7103e4 (patch)
tree8fde8cdc22ffd77f1d23b35830d51bba129d70ad /convert_str.c
parentdafee6410a4ecd7400a83adf84ded3621f30a365 (diff)
downloadft_printf-3f2ef05278d42233f0a9ee9652e152824a7103e4.tar.gz
ft_printf-3f2ef05278d42233f0a9ee9652e152824a7103e4.tar.bz2
ft_printf-3f2ef05278d42233f0a9ee9652e152824a7103e4.zip
ft_printf write to buffer instead of instant write
Diffstat (limited to 'convert_str.c')
-rw-r--r--convert_str.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/convert_str.c b/convert_str.c
index 5bba1b1..42bf851 100644
--- a/convert_str.c
+++ b/convert_str.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/30 23:22:25 by cacharle #+# #+# */
-/* Updated: 2019/11/05 23:43:57 by cacharle ### ########.fr */
+/* Updated: 2019/11/09 01:07:24 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,7 +18,7 @@ char *convert_str(va_list ap, t_pformat *pformat)
str = va_arg(ap, char*);
str = str == NULL ? ft_strdup("(null)") : ft_strdup(str);
- if (pformat->precision != -1 && pformat->precision < (int)ft_strlen(str))
+ if (pformat->precision >= 0 && pformat->precision < (int)ft_strlen(str))
str[pformat->precision] = '\0';
str = handle_width(pformat, str);
return (str);