[klibc] [PATCH 1/1, RESEND] tests: Fix sscanf test where width = 1 and integer is negative

Mike Pagano mpagano at gentoo.org
Mon Jun 10 15:15:43 PDT 2013

Sorry for the previous HTML message. This time in plain text.

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 sothe 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);
-   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);

More information about the klibc mailing list