aboutsummaryrefslogtreecommitdiff
path: root/ft_strdup.s
diff options
context:
space:
mode:
Diffstat (limited to 'ft_strdup.s')
-rw-r--r--ft_strdup.s26
1 files changed, 13 insertions, 13 deletions
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