From: Johannes Berg Date: Tue, 8 May 2007 07:27:20 +0000 (-0700) Subject: fix sscanf %n match at end of input string X-Git-Tag: v2.6.22-rc1~715 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6b40d16d1cfa1a01158049bb887a9bbe48ef7ba;p=pandora-kernel.git 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. [akpm@linux-foundation.org: cleanups] Signed-off-by: Johannes Berg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed