Lines 3739-3754
static tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name,
Link Here
|
3739 |
/* and prompts attributes unless --literal-attributes is set to yes */ |
3740 |
/* and prompts attributes unless --literal-attributes is set to yes */ |
3740 |
/* #994841 - Whitespace is removed from value attributes */ |
3741 |
/* #994841 - Whitespace is removed from value attributes */ |
3741 |
|
3742 |
|
3742 |
if (munge && |
3743 |
/* Issue #217 - Also only if/while (len > 0) - MUST NEVER GO NEGATIVE! */ |
|
|
3744 |
if ((len > 0) && munge && |
3743 |
TY_(tmbstrcasecmp)(name, "alt") && |
3745 |
TY_(tmbstrcasecmp)(name, "alt") && |
3744 |
TY_(tmbstrcasecmp)(name, "title") && |
3746 |
TY_(tmbstrcasecmp)(name, "title") && |
3745 |
TY_(tmbstrcasecmp)(name, "value") && |
3747 |
TY_(tmbstrcasecmp)(name, "value") && |
3746 |
TY_(tmbstrcasecmp)(name, "prompt")) |
3748 |
TY_(tmbstrcasecmp)(name, "prompt")) |
3747 |
{ |
3749 |
{ |
3748 |
while (TY_(IsWhite)(lexer->lexbuf[start+len-1])) |
3750 |
while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0)) |
3749 |
--len; |
3751 |
--len; |
3750 |
|
3752 |
|
3751 |
while (TY_(IsWhite)(lexer->lexbuf[start]) && start < len) |
3753 |
while (TY_(IsWhite)(lexer->lexbuf[start]) && (start < len) && (len > 0)) |
3752 |
{ |
3754 |
{ |
3753 |
++start; |
3755 |
++start; |
3754 |
--len; |
3756 |
--len; |