printf fix: Decrease rdi if padding is not 0 and specifier is invalid (assure '%' is printed)
This commit is contained in:
@@ -297,6 +297,10 @@ printf:
|
|||||||
|
|
||||||
;--- Invalid ---;
|
;--- Invalid ---;
|
||||||
.invalidReplacement:
|
.invalidReplacement:
|
||||||
|
test r12, r12
|
||||||
|
jz .irNoPadding
|
||||||
|
dec rdi
|
||||||
|
.irNoPadding:
|
||||||
cmp byte [rdi + 1], '\'
|
cmp byte [rdi + 1], '\'
|
||||||
je .invalidReplacement_specialChar; '%\n' would become "'%','\','n'" instead of "'%',EOS" when inserting full invalid specifier.
|
je .invalidReplacement_specialChar; '%\n' would become "'%','\','n'" instead of "'%',EOS" when inserting full invalid specifier.
|
||||||
mov r9w, word [rdi]
|
mov r9w, word [rdi]
|
||||||
|
Reference in New Issue
Block a user