Эх сурвалжийг харах

__psfs_parse_spec: always use long int for %p

closes bug #3037
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 15 жил өмнө
parent
commit
e0d2b8e59b
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      libc/stdio/_scanf.c

+ 4 - 1
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[ -> ?? */
 			}