When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain floating-point formats.
This commit is contained in:
parent
080f4020a3
commit
38d17374b2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user