aboutsummaryrefslogtreecommitdiff
path: root/tools/cfsml.pl
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-02-22 22:07:30 +0000
committerWillem Jan Palenstijn2009-02-22 22:07:30 +0000
commita5a29a44e9f129a3bff8cc93a02b71b17b7e9163 (patch)
tree9cf81ed5d0f4229f796d44c1a7fad1fc1e81ab6b /tools/cfsml.pl
parent4c1349e0f436c273b79073c39ced1b224f6a4371 (diff)
downloadscummvm-rg350-a5a29a44e9f129a3bff8cc93a02b71b17b7e9163.tar.gz
scummvm-rg350-a5a29a44e9f129a3bff8cc93a02b71b17b7e9163.tar.bz2
scummvm-rg350-a5a29a44e9f129a3bff8cc93a02b71b17b7e9163.zip
Check for end of file more often while reading CFSML
svn-id: r38796
Diffstat (limited to 'tools/cfsml.pl')
-rw-r--r--tools/cfsml.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/cfsml.pl b/tools/cfsml.pl
index bc543e8fc7..ac00bfb397 100644
--- a/tools/cfsml.pl
+++ b/tools/cfsml.pl
@@ -777,13 +777,18 @@ sub insert_reader_code {
if ($firsttoken) {
write_line_pp(__LINE__, 0);
print " const char *_cfsml_inp = $firsttoken;\n";
+ print " {\n";
} else {
write_line_pp(__LINE__, 0);
- print " const char *_cfsml_inp = _cfsml_get_identifier($fh, &($linecounter), &_cfsml_eof, 0);\n\n";
+ print " const char *_cfsml_inp = _cfsml_get_identifier($fh, &($linecounter), &_cfsml_eof, 0);\n";
+ print " if (!_cfsml_inp) {\n";
+ print " _cfsml_error = CFSML_FAILURE;\n";
+ print " } else {\n";
}
write_line_pp(__LINE__, 0);
- print " _cfsml_error = $types{$type}{'reader'}($fh, $datap, _cfsml_inp, &($linecounter), &_cfsml_eof);\n";
+ print " _cfsml_error = $types{$type}{'reader'}($fh, $datap, _cfsml_inp, &($linecounter), &_cfsml_eof);\n";
+ print " }\n";
if ($eofvar) {
write_line_pp(__LINE__, 0);