X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Fvariable-display.c;h=461648557a05eaf017ffd1e67f8280c0a99fd3e6;hb=cd221d80fafb54e550398c6de105d4c1b7f02ba0;hp=1fa17017e09556c662bf8ab7d0da5a7cd398eb71;hpb=b56f017491ffecdbe19e39aca242ffb13ad17016;p=pspp diff --git a/src/language/dictionary/variable-display.c b/src/language/dictionary/variable-display.c index 1fa17017e0..461648557a 100644 --- a/src/language/dictionary/variable-display.c +++ b/src/language/dictionary/variable-display.c @@ -103,7 +103,8 @@ cmd_variable_width (struct lexer *lexer, struct dataset *ds) if (!parse_variables (lexer, dataset_dict (ds), &v, &nv, PV_NONE)) return CMD_FAILURE; - if (!lex_force_match (lexer, T_LPAREN) || !lex_force_int (lexer)) + if (!lex_force_match (lexer, T_LPAREN) + || !lex_force_int_range (lexer, NULL, 1, INT_MAX)) { free (v); return CMD_FAILURE; @@ -116,12 +117,6 @@ cmd_variable_width (struct lexer *lexer, struct dataset *ds) return CMD_FAILURE; } - if (width < 0) - { - msg (SE, _("Variable display width must be a positive integer.")); - free (v); - return CMD_FAILURE; - } width = MIN (width, 2 * MAX_STRING); for(i = 0 ; i < nv ; ++i)