OSDN Git Service

__psfs_parse_spec: always use long int for %p
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 11 Jan 2011 18:46:56 +0000 (19:46 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 11 Jan 2011 18:47:58 +0000 (19:47 +0100)
closes bug #3037
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/stdio/_scanf.c

index 34c1c9a..28cd21e 100644 (file)
@@ -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[ -> ?? */
                        }