summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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[ -> ?? */
}