From e0d2b8e59beba49d6c2bdcf24257cc1834ce2b26 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 11 Jan 2011 19:46:56 +0100 Subject: __psfs_parse_spec: always use long int for %p closes bug #3037 Signed-off-by: Bernhard Reutner-Fischer --- libc/stdio/_scanf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libc/stdio/_scanf.c') diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c index 34c1c9abd..28cd21e30 100644 --- a/libc/stdio/_scanf.c +++ b/libc/stdio/_scanf.c @@ -924,7 +924,10 @@ int attribute_hidden __psfs_parse_spec(register psfs_t *psfs) goto ERROR_EINVAL; } - if ((p_m_spec_chars >= CONV_c) + if (p_m_spec_chars == CONV_p) { + /* a pointer has the same size as 'long int' */ + psfs->dataargtype = PA_FLAG_LONG; + } else if ((p_m_spec_chars >= CONV_c) && (psfs->dataargtype & PA_FLAG_LONG)) { p_m_spec_chars -= 3; /* lc -> C, ls -> S, l[ -> ?? */ } -- cgit v1.2.3