{
lex_force_int (lexer);
qc.ngroups = lex_integer (lexer);
+ if (qc.ngroups <= 0)
+ {
+ lex_error (lexer, _("The number of clusters must be positive"));
+ goto error;
+ }
lex_get (lexer);
lex_force_match (lexer, T_RPAREN);
}
{
lex_force_int (lexer);
qc.maxiter = lex_integer (lexer);
+ if (qc.maxiter <= 0)
+ {
+ lex_error (lexer, _("The number of iterations must be positive"));
+ goto error;
+ }
lex_get (lexer);
lex_force_match (lexer, T_RPAREN);
}
AT_CLEANUP
+
+
+
+AT_SETUP([QUICK CLUSTER crash on bad cluster quantity])
+AT_DATA([badn.sps], [dnl
+data list notable list /x * y *.
+begin data.
+1 2
+1 2.2
+end data.
+
+QUICK CLUSTER x y
+ /CRITERIA = CLUSTER(0)
+ .
+])
+
+AT_CHECK([pspp -O format=csv badn.sps], [1], [ignore])
+
+AT_CLEANUP
\ No newline at end of file