Bring the local vars into the context, which is allowed in C89.

This commit is contained in:
Jim Derry 2017-03-09 12:44:48 -05:00
parent 005127c733
commit e27cc262fe

View file

@ -906,8 +906,6 @@ Bool TY_(ParseConfigOption)( TidyDocImpl* doc, ctmbstr optnam, ctmbstr optval )
Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval ) Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval )
{ {
const TidyOptionImpl* option = NULL; const TidyOptionImpl* option = NULL;
enum { sizeBuf = 11 };
char buffer[sizeBuf];
/* #472: fail status if there is a NULL parser. @ralfjunker */ /* #472: fail status if there is a NULL parser. @ralfjunker */
Bool status = ( optId < N_TIDY_OPTIONS Bool status = ( optId < N_TIDY_OPTIONS
&& (option = option_defs + optId)->parser && (option = option_defs + optId)->parser
@ -920,6 +918,8 @@ Bool TY_(ParseConfigValue)( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval
{ {
/* If optId < N_TIDY_OPTIONS then option remains unassigned, /* If optId < N_TIDY_OPTIONS then option remains unassigned,
and we have to fall back to an ugly error message. */ and we have to fall back to an ugly error message. */
enum { sizeBuf = 11 }; /* uint_max is 10 characters */
char buffer[sizeBuf];
TY_(tmbsnprintf(buffer, sizeBuf, "%u", optId)); TY_(tmbsnprintf(buffer, sizeBuf, "%u", optId));
TY_(ReportUnknownOption(doc, buffer)); TY_(ReportUnknownOption(doc, buffer));
} }