Skip to content

Commit

Permalink
Add %n
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Aug 23, 2020
1 parent 20f91d9 commit 7dcc865
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lwprintf/src/lwprintf/lwprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ prv_format(lwprintf_int_t* p, va_list arg) {
case 'g':
case 'G':
break;
case 'n': {
int* ptr = (void*)va_arg(arg, int*);
*ptr = p->n; /* Write current length */

break;
}
case '%':
p->out_fn(p, '%');
break;
Expand Down

0 comments on commit 7dcc865

Please sign in to comment.