DATA LIST: Fix assertion when RECORDS given twice with decreasing value.
[pspp] / src / language / xforms / sample.c
index f2a30a2a58fdbfc5e94958eec4bd65fbdc710464..7184562ef2943fd060357450adee5f600658c529 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <math.h>
 
-#include "data/procedure.h"
+#include "data/dataset.h"
 #include "data/variable.h"
 #include "language/command.h"
 #include "language/lexer/lexer.h"
@@ -88,17 +88,9 @@ cmd_sample (struct lexer *lexer, struct dataset *ds)
       lex_get (lexer);
       if (!lex_force_match_id (lexer, "FROM"))
        return CMD_FAILURE;
-      if (!lex_force_int (lexer))
+      if (!lex_force_int_range (lexer, "FROM", a + 1, INT_MAX))
        return CMD_FAILURE;
       b = lex_integer (lexer);
-      if (a >= b)
-       {
-         msg (SE, _("Cannot sample %d observations from a population of "
-                    "%d."),
-              a, b);
-         return CMD_FAILURE;
-       }
-
       frac = 0;
     }
   lex_get (lexer);