FLIP: Eliminate false dependency on VAR_NAME_LEN.
[pspp-builds.git] / src / language / stats / flip.c
index 77881868b0c3fcc0fd3b8fa29ead25b117882b95..487417bab149c682fb16c2047d3d416da50e9ffd 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -109,23 +109,23 @@ cmd_flip (struct lexer *lexer, struct dataset *ds)
   flip->error = false;
   flip->dict = dict;
 
-  lex_match (lexer, '/');
+  lex_match (lexer, T_SLASH);
   if (lex_match_id (lexer, "VARIABLES"))
     {
-      lex_match (lexer, '=');
+      lex_match (lexer, T_EQUALS);
       if (!parse_variables_const (lexer, dict, &vars, &flip->n_vars,
                                   PV_NO_DUPLICATE))
        goto error;
-      lex_match (lexer, '/');
+      lex_match (lexer, T_SLASH);
     }
   else
     dict_get_vars (dict, &vars, &flip->n_vars, DC_SYSTEM);
   pool_register (flip->pool, free, vars);
 
-  lex_match (lexer, '/');
+  lex_match (lexer, T_SLASH);
   if (lex_match_id (lexer, "NEWNAMES"))
     {
-      lex_match (lexer, '=');
+      lex_match (lexer, T_EQUALS);
       flip->new_names_var = parse_variable (lexer, dict);
       if (!flip->new_names_var)
         goto error;
@@ -209,7 +209,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds)
       make_new_var (dict, flip->new_names.names[i]);
     else
       {
-        char s[VAR_NAME_LEN + 1];
+        char s[3 + INT_STRLEN_BOUND (i) + 1];
         sprintf (s, "VAR%03zu", i);
         dict_create_var_assert (dict, s, 0);
       }