mirror of https://github.com/tailix/libkernaux.git
Implement %c formatter
This commit is contained in:
parent
298761e5e4
commit
0eb355f1fa
|
@ -199,6 +199,10 @@ void kernaux_printf_va(
|
|||
putchar(*arg_ptr);
|
||||
}
|
||||
}
|
||||
else if (formatter.type == TYPE_c) {
|
||||
const char arg = va_arg(va, int);
|
||||
putchar(arg);
|
||||
}
|
||||
}
|
||||
|
||||
putchar('\0');
|
||||
|
|
|
@ -40,6 +40,8 @@ int main()
|
|||
|
||||
test("", "");
|
||||
test("Hello, World!", "Hello, World!");
|
||||
test("Hello, Alex!", "Hello, %s!", "Alex");
|
||||
test("Hello, Alex!", "Hello, %c%c%c%c!", 'A', 'l', 'e', 'x');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue