grub_script_lexer_yywrap: Update len synchronously with line.

This commit is contained in:
Vladimir Serbinenko 2015-01-20 12:53:20 +01:00
parent 59d4036594
commit 66ce4d1aef
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/script/lexer.c (grub_script_lexer_yywrap): Update len
synchronously with line.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com> 2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
Replace explicit sizeof divisions by ARRAY_SIZE. Replace explicit sizeof divisions by ARRAY_SIZE.

View file

@ -164,6 +164,7 @@ grub_script_lexer_yywrap (struct grub_parser_param *parserstate,
{ {
grub_free (line); grub_free (line);
line = grub_strdup ("\n"); line = grub_strdup ("\n");
len = 1;
} }
else if (len && line[len - 1] != '\n') else if (len && line[len - 1] != '\n')
{ {