From 38d17374b202aebccf1ac1aba9b71288a6e008e2 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sun, 2 May 2004 10:55:05 +0000 Subject: [PATCH] When *printf() and *scanf() are compiled without floating-point support, fmtcheck() should not accept format strings that contain floating-point formats. --- lib/libc/gen/fmtcheck.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/gen/fmtcheck.c b/lib/libc/gen/fmtcheck.c index eb5326dd347c..661cb8a020bb 100644 --- a/lib/libc/gen/fmtcheck.c +++ b/lib/libc/gen/fmtcheck.c @@ -57,8 +57,10 @@ enum __e_fmtcheck_types { FMTCHECK_QUADPOINTER, FMTCHECK_PTRDIFFTPOINTER, FMTCHECK_SIZETPOINTER, +#ifndef NO_FLOATING_POINT FMTCHECK_DOUBLE, FMTCHECK_LONGDOUBLE, +#endif FMTCHECK_STRING, FMTCHECK_WIDTH, FMTCHECK_PRECISION, @@ -149,6 +151,7 @@ get_next_format_from_precision(const char **pf) RETURN(pf,f,FMTCHECK_UNKNOWN); RETURN(pf,f,FMTCHECK_LONG); } +#ifndef NO_FLOATING_POINT if (strchr("aAeEfFgG", *f)) { if (longdouble) RETURN(pf,f,FMTCHECK_LONGDOUBLE); @@ -156,6 +159,7 @@ get_next_format_from_precision(const char **pf) RETURN(pf,f,FMTCHECK_UNKNOWN); RETURN(pf,f,FMTCHECK_DOUBLE); } +#endif if (*f == 'c') { if (sh + lg + quad + longdouble + ptrdifft + sizet) RETURN(pf,f,FMTCHECK_UNKNOWN);