* src/reader.c (parse_expect_decl): Use `skip_white_space' and

`read_signed_integer'.
This commit is contained in:
Akim Demaille
2000-10-16 18:05:01 +00:00
parent 79282c5ad0
commit 131e2fef68
2 changed files with 10 additions and 19 deletions

View File

@@ -1,3 +1,9 @@
2000-10-16 Akim Demaille <akim@epita.fr>
* src/reader.c (parse_expect_decl): Use `skip_white_space' and
`read_signed_integer'.
2000-10-16 Akim Demaille <akim@epita.fr>
* src/reader.c (copy_dollar): New function.

View File

@@ -773,28 +773,13 @@ parse_union_decl (void)
static void
parse_expect_decl (void)
{
int c;
size_t count;
char buffer[20];
c = getc (finput);
while (c == ' ' || c == '\t')
c = getc (finput);
count = 0;
while (c >= '0' && c <= '9')
{
if (count < sizeof(buffer) - 1)
buffer[count++] = c;
c = getc (finput);
}
buffer[count] = 0;
int c = skip_white_space ();
ungetc (c, finput);
if (count <= 0 || count > 10)
if (!isdigit (c))
complain (_("argument of %%expect is not an integer"));
expected_conflicts = atoi (buffer);
else
expected_conflicts = read_signed_integer (finput);
}