X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fdescriptives.c;h=7182049a6668850f02ffc28c08c9f1d58cf7773e;hb=0e0cabc772b5f3a416e1e4e1dc021e196ac2c443;hp=1ffe861552b6aaae990816bb08097a2e4db7f617;hpb=0df9cdd3df66caf4353128feff3008289cda8115;p=pspp diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 1ffe861552..7182049a66 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -284,7 +284,15 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds) else if (lex_match_id (lexer, "DEFAULT")) dsc->show_stats |= DEFAULT_STATS; else - dsc->show_stats |= 1ul << (match_statistic (lexer)); + { + enum dsc_statistic s = match_statistic (lexer); + if (s == DSC_NONE ) + { + lex_error (lexer, NULL); + goto error; + } + dsc->show_stats |= 1ul << s; + } lex_match (lexer, T_COMMA); } if (dsc->show_stats == 0) @@ -309,7 +317,8 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds) dsc->sort_ascending = 0; else lex_error (lexer, NULL); - lex_force_match (lexer, T_RPAREN); + if (! lex_force_match (lexer, T_RPAREN)) + goto error; } } else if (var_cnt == 0)