[git commit master 1/1] __psfs_parse_spec: always use long int for %p

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Tue Jan 11 18:47:58 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=e0d2b8e59beba49d6c2bdcf24257cc1834ce2b26
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

closes bug #3037
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/stdio/_scanf.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c
index 34c1c9a..28cd21e 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[ -> ?? */
 			}
-- 
1.7.2.2



More information about the uClibc-cvs mailing list