projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
render: Add comment.
[pspp]
/
src
/
language
/
data-io
/
data-list.c
diff --git
a/src/language/data-io/data-list.c
b/src/language/data-io/data-list.c
index 90d060eaab66721a8462fcb81baa351494177441..754341ccac3a120c8dc840e4d261894db54e9ba1 100644
(file)
--- a/
src/language/data-io/data-list.c
+++ b/
src/language/data-io/data-list.c
@@
-122,7
+122,14
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
lex_match (lexer, T_LPAREN);
if (!lex_force_int (lexer))
goto error;
lex_match (lexer, T_LPAREN);
if (!lex_force_int (lexer))
goto error;
- data_parser_set_records (parser, lex_integer (lexer));
+
+ int records = lex_integer (lexer);
+ if (records < 0)
+ {
+ msg (SE, _("The %s value must be non-negative."), "RECORDS");
+ goto error;
+ }
+ data_parser_set_records (parser, records);
lex_get (lexer);
lex_match (lexer, T_RPAREN);
}
lex_get (lexer);
lex_match (lexer, T_RPAREN);
}
@@
-131,7
+138,13
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
lex_match (lexer, T_EQUALS);
if (!lex_force_int (lexer))
goto error;
lex_match (lexer, T_EQUALS);
if (!lex_force_int (lexer))
goto error;
- data_parser_set_skip (parser, lex_integer (lexer));
+ int skip = lex_integer (lexer);
+ if (skip < 0)
+ {
+ msg (SE, _("The %s value must be non-negative."), "SKIP");
+ goto error;
+ }
+ data_parser_set_skip (parser, skip);
lex_get (lexer);
}
else if (lex_match_id (lexer, "END"))
lex_get (lexer);
}
else if (lex_match_id (lexer, "END"))
@@
-293,7
+306,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
}
else
add_transformation (ds, data_list_trns_proc, data_list_trns_free, trns);
}
else
- data_parser_make_active_file (parser, ds, reader, dict);
+ data_parser_make_active_file (parser, ds, reader, dict
, NULL, NULL
);
fh_unref (fh);
free (encoding);
fh_unref (fh);
free (encoding);
@@
-303,7
+316,7
@@
cmd_data_list (struct lexer *lexer, struct dataset *ds)
error:
data_parser_destroy (parser);
if (!in_input_program ())
error:
data_parser_destroy (parser);
if (!in_input_program ())
- dict_
destroy
(dict);
+ dict_
unref
(dict);
fh_unref (fh);
free (encoding);
return CMD_CASCADING_FAILURE;
fh_unref (fh);
free (encoding);
return CMD_CASCADING_FAILURE;