aboutsummaryrefslogtreecommitdiff
path: root/ft_itoa.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-11-20 01:06:49 +0100
committerCharles <sircharlesaze@gmail.com>2019-11-20 01:44:43 +0100
commita46f13dc1fef2af96f418984af9db6acfeaeb581 (patch)
treee8952acaba6442d3968d270c172884d0bfdcf5db /ft_itoa.c
parentfbd1d450b0c2da394cbb02fd61ab75b2719bfb72 (diff)
downloadlibft-a46f13dc1fef2af96f418984af9db6acfeaeb581.tar.gz
libft-a46f13dc1fef2af96f418984af9db6acfeaeb581.tar.bz2
libft-a46f13dc1fef2af96f418984af9db6acfeaeb581.zip
Taking advantage of the ascii table tricks
ft_toupper, ft_tolower, ft_atoi, ft_itoa
Diffstat (limited to 'ft_itoa.c')
-rw-r--r--ft_itoa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ft_itoa.c b/ft_itoa.c
index 426937e..03d794b 100644
--- a/ft_itoa.c
+++ b/ft_itoa.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:19:56 by cacharle #+# #+# */
-/* Updated: 2019/10/07 10:21:23 by cacharle ### ########.fr */
+/* Updated: 2019/11/20 01:15:40 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -56,7 +56,7 @@ char *ft_itoa(int n)
len--;
while (len >= (is_negative ? 1 : 0))
{
- str[len] = u_nbr % 10 + '0';
+ str[len] = (u_nbr % 10) | 0x30;
u_nbr /= 10;
len--;
}