d3dxof: Make is_keyword handle end of file correctly.

oldstable
Christian Costa 2009-02-10 14:07:19 +01:00 committed by Alexandre Julliard
parent ecb6c2169c
commit db30aa149e
1 changed files with 13 additions and 3 deletions

View File

@ -273,10 +273,20 @@ static WORD get_operator_token(char c)
static BOOL is_keyword(parse_buffer* buf, const char* keyword)
{
char tmp[9]; /* template keyword size + 1 */
char tmp[8]; /* longest keyword size (template) */
DWORD len = strlen(keyword);
read_bytes(buf, tmp, len+1);
if (!strncasecmp(tmp, keyword,len) && is_separator(tmp[len]))
if (!read_bytes(buf, tmp, len))
return FALSE;
if (strncasecmp(tmp, keyword, len))
{
rewind_bytes(buf, len);
return FALSE;
}
if (!read_bytes(buf, tmp, 1))
return TRUE;
if (is_separator(tmp[0]))
{
rewind_bytes(buf, 1);
return TRUE;