Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
4348a750
Commit
4348a750
authored
May 06, 2012
by
Alejandro Mery
Browse files
fex2bin: break parsing loop when it's not ok
parent
7020ebff
Changes
1
Hide whitespace changes
Inline
Side-by-side
fex2bin.c
View file @
4348a750
...
...
@@ -53,7 +53,7 @@ static int parse_fex(FILE *in, const char *filename, struct script *script)
struct
script_section
*
last_section
=
NULL
;
/* TODO: deal with longer lines correctly (specially in comments) */
for
(
size_t
line
=
1
;
fgets
(
buffer
,
sizeof
(
buffer
),
in
);
line
++
)
{
for
(
size_t
line
=
1
;
ok
&&
fgets
(
buffer
,
sizeof
(
buffer
),
in
);
line
++
)
{
char
*
s
=
skip_blank
(
buffer
);
/* beginning */
char
*
pe
=
s
;
/* \0... to be found */
...
...
@@ -91,6 +91,7 @@ static int parse_fex(FILE *in, const char *filename, struct script *script)
errf
(
"E: %s:%zu: incomplete section declaration.
\n
"
,
filename
,
line
);
}
ok
=
0
;
}
else
{
/* key = value */
const
char
*
key
=
s
;
...
...
@@ -177,7 +178,7 @@ static int parse_fex(FILE *in, const char *filename, struct script *script)
errf
(
"E: %s:%zu: invalid character at %zu.
\n
"
,
filename
,
line
,
p
-
buffer
+
1
);
}
ok
=
0
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment