From d6240e3f6aeb342aaf13284c7cc93226970648aa Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 11 Feb 2021 15:44:44 +0100 Subject: Replaced tab with spaces --- ft_strdup.s | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'ft_strdup.s') diff --git a/ft_strdup.s b/ft_strdup.s index 346f2b4..09ae2ba 100644 --- a/ft_strdup.s +++ b/ft_strdup.s @@ -32,20 +32,20 @@ global M_FT_STRDUP section .text ; char *ft_strdup(const char *str); M_FT_STRDUP: - push rdi ; save rdi because it will be overwrite for malloc + push rdi ; save rdi because it will be overwrite for malloc - call M_FT_STRLEN ; rdi is still == str - inc rax ; len++ for '\0' + call M_FT_STRLEN ; rdi is still == str + inc rax ; len++ for '\0' - mov rdi, rax ; size to malloc - call M_MALLOC wrt ..plt - cmp rax, 0 - je FT_STRDUP_ERROR + mov rdi, rax ; size to malloc + call M_MALLOC wrt ..plt + cmp rax, 0 + je FT_STRDUP_ERROR - pop rsi ; original str as src - mov rdi, rax ; allocated as dest - call M_FT_STRCPY - ret + pop rsi ; original str as src + mov rdi, rax ; allocated as dest + call M_FT_STRCPY + ret FT_STRDUP_ERROR: - pop rdi - ret + pop rdi + ret -- cgit