mirror of
https://github.com/linux-msm/qmic.git
synced 2024-11-23 09:44:06 +08:00
parser: don't treat 8 as a valid octal digit
The function isodigit() was defined to mimic isxdigit(), indicating
whether a given character was an octal digit. But as written, it
considers '8' to be a valid octal digit, which it is not. Fix this
bug.
In addition, the "bad_octal.qmi" test file refers to an undefined
"test_struct" as a message member type. Fix that by using u32
instead.
Fixes: 61f6fe9
("parser: be more restrictive when parsing numbers")
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
parent
4937e55261
commit
de50c02678
2
parser.c
2
parser.c
@ -257,7 +257,7 @@ static struct symbol *qmi_identifier_parse(char *buf, size_t size, char ch)
|
||||
/* Used for parsing octal numbers */
|
||||
static int isodigit(int c)
|
||||
{
|
||||
return isdigit(c) && c < '9';
|
||||
return isdigit(c) && c < '8';
|
||||
}
|
||||
|
||||
/* Extract a number from input into the given buffer; return base */
|
||||
|
@ -7,7 +7,7 @@ struct qmi_result {
|
||||
|
||||
request test_request {
|
||||
# Note that '8' is not a valid octal digit
|
||||
optional test_struct foo = 028;
|
||||
optional u32 foo = 028;
|
||||
} = 0x23;
|
||||
|
||||
response test_response {
|
||||
|
Loading…
Reference in New Issue
Block a user