READ negative tests
[pspp] / src / language / data-io / save.c
index efc7e09d230b2e28442ddf152bb2a16e0b6c1bfe..a5848e59f5ce12f08b5de428df5fb7154cc9ed09 100644 (file)
@@ -269,7 +269,7 @@ parse_write_command (struct lexer *lexer, struct dataset *ds,
                && lex_match_id (lexer, "VERSION"))
        {
          lex_match (lexer, T_EQUALS);
-         if (!lex_force_int (lexer))
+         if (!lex_force_int_range (lexer, "VERSION", 2, 3))
             goto error;
           sysfile_opts.version = lex_integer (lexer);
           lex_get (lexer);
@@ -290,12 +290,12 @@ parse_write_command (struct lexer *lexer, struct dataset *ds,
       else if (writer_type == PORFILE_WRITER && lex_match_id (lexer, "DIGITS"))
         {
           lex_match (lexer, T_EQUALS);
-          if (!lex_force_int (lexer))
+          if (!lex_force_int_range (lexer, "DIGITS", 1, INT_MAX))
             goto error;
           porfile_opts.digits = lex_integer (lexer);
           lex_get (lexer);
         }
-      else if (!parse_dict_trim (lexer, dict))
+      else if (!parse_dict_trim (lexer, dict, false))
         goto error;
 
       if (!lex_match (lexer, T_SLASH))