Mike Pagano
2013-Jun-09 01:00 UTC
[klibc] [PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
sscanf can take an integer which specifies the maximum field width. In this test, the field width is 1 and the input is a negative number so the test fails. This patch increases the maximum field width to 2. Signed-off-by: Mike Pagano <mpagano at gentoo.org> --- usr/klibc/tests/sscanf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/klibc/tests/sscanf.c b/usr/klibc/tests/sscanf.c index 0102ee3..454edc1 100644 --- a/usr/klibc/tests/sscanf.c +++ b/usr/klibc/tests/sscanf.c @@ -27,7 +27,7 @@ int main() printf("Error wrong sscanf int return %d.\n", ret); err++; } - ret = sscanf(a2, "%1d%2d", &e1, &e2); + ret = sscanf(a2, "%2d%2d", &e1, &e2); if (ret != 2) { printf("Error wrong sscanf int return %d.\n", ret); err++; -- 1.8.1.5 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.zytor.com/pipermail/klibc/attachments/20130608/04ca5a47/attachment.html>
maximilian attems
2013-Aug-20 22:24 UTC
[klibc] [PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
sorry for the late reply, checking all the backlog now. On Sat, 08 Jun 2013, Mike Pagano wrote:> sscanf can take an integer which specifies the maximum field width. > In this test, the field width is 1 and the input is a negative number so > the test fails. > > This patch increases the maximum field width to 2.thanks, but can you post the failure you are seeing? The one I see is related to the double fields that klibc can't probably shouldn't handle, hence maybe those tests should be disabled: ./usr/klibc/tests/sscanfError wrong sscanf double return 0. Error wrong sscanf double return 0. Error wrong sscanf double return 0. -- maks
maximilian attems
2013-Aug-21 09:53 UTC
[klibc] [PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
> On Sat, 08 Jun 2013, Mike Pagano wrote: > > > sscanf can take an integer which specifies the maximum field width. > > In this test, the field width is 1 and the input is a negative number so > > the test fails. > > > > This patch increases the maximum field width to 2.fixed in latest git: https://git.kernel.org/cgit/libs/klibc/klibc.git/ Thanks. -- maks
Reasonably Related Threads
- [PATCH 1/1, RESEND] tests: Fix sscanf test where width = 1 and integer is negative
- [klibc:master] tests: Fix sscanf integer tests
- [PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
- [PATCH 1/1] Modify --param support to include additional option
- [PATCH] support the gcc parameter --param in klcc