Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix sscanf %n match at end of input string
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); /* doesn't work */ sscanf("abc123a", "abc%d%n", &a, &n); /* works */ However, the scanf function in the kernel doesn't convert the %n in that case because it has already matched the complete input after %d and just completely stops matching then. This patch fixes that. [[email protected]: cleanups] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information