mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
AK: Implement %n printf specifier
This is a special specifier that does not output anything to the stream, but saves the number of already output chars to the provided pointer. This is apparently used by GNU Nano.
This commit is contained in:
committed by
Andreas Kling
parent
f686b5b51b
commit
cf7910fc1e
@@ -358,6 +358,11 @@ template<typename PutChFunc>
|
||||
case 'p':
|
||||
ret += print_hex(putch, bufptr, va_arg(ap, u32), *p == 'P', true, false, true, 8);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
*va_arg(ap, int*) = ret;
|
||||
break;
|
||||
|
||||
default:
|
||||
dbg() << "printf_internal: Unimplemented format specifier " << *p << " (fmt: " << fmt << ")";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user