X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fdictionary%2Fattributes.c;h=88832fd501f641ebcc041c1558fa3d214047c454;hb=f5711a3a6d3f28e53513269e774bfa1e8274c1c5;hp=2f1d6906b9b6b4ee1b76b62857f0968673f8fc99;hpb=6e097c89af440da90b43ce90864394c4d0c843d5;p=pspp diff --git a/src/language/dictionary/attributes.c b/src/language/dictionary/attributes.c index 2f1d6906b9..88832fd501 100644 --- a/src/language/dictionary/attributes.c +++ b/src/language/dictionary/attributes.c @@ -97,13 +97,8 @@ parse_attribute_name (struct lexer *lexer, const char *dict_encoding, if (lex_match (lexer, T_LBRACK)) { - if (!lex_force_int (lexer)) + if (!lex_force_int_range (lexer, NULL, 1, 65535)) goto error; - if (lex_integer (lexer) < 1 || lex_integer (lexer) > 65535) - { - msg (SE, _("Attribute array index must be between 1 and 65535.")); - goto error; - } *index = lex_integer (lexer); lex_get (lexer); if (!lex_force_match (lexer, T_RBRACK)) @@ -197,7 +192,7 @@ parse_attributes (struct lexer *lexer, const char *dict_encoding, command = DELETE; else if (command == UNKNOWN) { - lex_error_expecting (lexer, "ATTRIBUTE=", "DELETE=", NULL_SENTINEL); + lex_error_expecting (lexer, "ATTRIBUTE=", "DELETE="); return CMD_FAILURE; }