Re: [PATCH] fix %*s%n in sscanf

From: Andy Spencer
Date: Fri Sep 25 2009 - 06:42:34 EST


> > int end;
> > char buf[] = "hello world";
> > sscanf(buf, "%*s%n", &end);
> > printf("%d\n", end);
>
> Yeah, seems reasonable. So, without your patch, sscanf() in kernel
> will ignore everything after '*', right?

Currently it ignores everything between '*' and whitespace. So '%*s%n'
does not work, but '%*s %n' will correctly return the start of "world".

Attachment: pgp00000.pgp
Description: PGP signature