__INTERNAL_fmt: write_format_data writes to array directly; do not strcat __fmt_Buff to array

This commit is contained in:
2025-08-01 11:01:16 +02:00
parent 68ee2828c1
commit 486b4d5d9b
2 changed files with 15 additions and 8 deletions

View File

@@ -524,14 +524,6 @@ __INTERNAL_fmt:
test rbx, rbx
jz .wrapup_print
mov byte [r15+r10+1], EOS
lea rdi, [r15]
lea rsi, [rel __fmt_Buff]
mov rdx, rbx
sub rsp, SIZE_QWORD
push r11
call strcat
pop rax
add rsp, SIZE_QWORD
jmp .quit
.wrapup_print:
mov rax, NR_write

View File

@@ -85,6 +85,7 @@ extern strcat
extern strclr
extern strcmp
extern strfind
extern format
;convert.asm
extern atoi
extern itoa
@@ -421,7 +422,11 @@ section .rodata
addTest(fgetmod2, "fgetmod(statbuff2)")
fgetmodStr db "\t- File permissions of file '%s': %04o\n",EOS
fmt_str db "%s",EOS
section .bss
fmt_out resb 5
fmt_over resb 64
inputBuffer_4 resb 4
inputBuffer_32 resb 32
strBuff1 resb 64
@@ -1660,6 +1665,16 @@ _start:
sub rcx, r14
call printf
lea rdi, [rel fmt_out]
mov rsi, 5
lea rdx, [rel fmt_str]
xor rcx, rcx
call format
lea rdi, [rel fmt_out]
call puts
lea rdi, [rel fmt_over]
call puts
;--- exit()
xor rdi, rdi
call exit