[c/stdio/sprintf] %% consumes an extra arg
paramsiddharth opened this issue · comments
- Have you checked the guidelines in our Contributing document?
Description
[c/stdio/sprintf
] %% consumes an extra arg
When trying to use %%
in sprintf
to represent a %
sign, it consumes an extra value from ...args
.
The following examples will explain it better:
-
Output:
const str = sprintf('%d%%%d.', 1, 2); console.log(str);
1%0.
-
Output:
const str = sprintf('%s is a %d%% %s %s.', 'Param', 90, 'good', 'boy'); console.log(str);
Param is a 90% boy undefined.
If approved, I would like to work on this issue.
@paramsiddharth thank you for reporting the bug. You are free to work on it. I'll then review the fix.
@paramsiddharth do you plan to submit a fix soon? Otherwise I'm ready to prepare one.
@paramsiddharth do you plan to submit a fix soon? Otherwise I'm ready to prepare one.
Yes! Pardon the delay! I'll let you know if I'm stuck. I'll make a PR soon!
Alright, the patch is now merged. Thanks for spotting the problem and fixing it.