Re: [hackers] [sbase][PATCH] printf: support escaping '%' with '%%'. See printf(1p) EXAMPLES section.

From: FRIGN <dev_AT_frign.de>
Date: Sun, 26 Jun 2016 20:36:26 +0200

On Sat, 25 Jun 2016 19:11:09 +0200
pranomostro <pranomestro_AT_gmail.com> wrote:

Hey Pranomostro,

nice catch! Care to send it as a git-patch?

Cheers

FRIGN

> ---
> printf.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/printf.c b/printf.c
> index 2e24817..7bf6fe5 100644
> --- a/printf.c
> +++ b/printf.c
> _AT_@ -103,8 +103,10 @@ main(int argc, char *argv[])
> arg = "";
> cooldown = 1;
> }
> - } else
> + } else {
> putchar('%');
> + continue;
> + }
>
> switch (format[i]) {
> case 'b':
> --
> 2.9.0


-- 
FRIGN <dev_AT_frign.de>
Received on Sun Jun 26 2016 - 20:36:26 CEST

This archive was generated by hypermail 2.3.0 : Sun Jun 26 2016 - 20:48:16 CEST