From 3640d9db93a1482436b84fbf47446b6e4d4b260d Mon Sep 17 00:00:00 2001 From: das Date: Sun, 2 May 2004 10:55:05 +0000 Subject: 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 eb5326d..661cb8a 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); -- cgit v1.1