[PATCH] make sscanf honor %n at end of input string

2007-02-28 Thread Johannes Berg
I was playing with some code that sometimes got a string where a %n match should have been done where the input string ended, for example like this: sscanf("abc123", "abc%d%n", , ); However, the scanf function in the kernel doesn't convert the %n in that case because it has already matched the

[PATCH] make sscanf honor %n at end of input string

2007-02-28 Thread Johannes Berg
I was playing with some code that sometimes got a string where a %n match should have been done where the input string ended, for example like this: sscanf(abc123, abc%d%n, a, n); However, the scanf function in the kernel doesn't convert the %n in that case because it has already matched the