summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-01-11 19:46:56 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-01-11 19:47:58 +0100
commite0d2b8e59beba49d6c2bdcf24257cc1834ce2b26 (patch)
treeb90c95d0469248ec166d7155129fcea67557aaf3 /libc
parent8764f2e75c875757529aa81e5cd96e17e6f6e5e4 (diff)
__psfs_parse_spec: always use long int for %p
closes bug #3037 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/stdio/_scanf.c5
1 files changed, 4 insertions, 1 deletions
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[ -> ?? */
}