Changed all the licence notices in all the files.
[pspp-builds.git] / src / descript.c
index 9acd21e673d48269afb0d96a36fc249663cc51d6..e0717993a18f4232164de6958b3247b55eac7f72 100644 (file)
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 /* FIXME: Many possible optimizations. */
 
@@ -29,6 +29,7 @@
 #include "case.h"
 #include "casefile.h"
 #include "command.h"
+#include "dictionary.h"
 #include "lexer.h"
 #include "error.h"
 #include "magic.h"
@@ -119,7 +120,7 @@ static const struct dsc_statistic_info dsc_info[DSC_N_STATS] =
 struct dsc_var
   {
     struct variable *v;         /* Variable to calculate on. */
-    char z_name[9];            /* Name for z-score variable. */
+    char z_name[SHORT_NAME_LEN + 1];/* Name for z-score variable. */
     double valid, missing;     /* Valid, missing counts. */
     struct moments *moments;    /* Moments. */
     double min, max;            /* Maximum and mimimum values. */
@@ -262,11 +263,7 @@ cmd_descriptives (void)
               else if (lex_match_id ("DEFAULT"))
                 dsc->show_stats |= DEFAULT_STATS;
               else
-               {
-                 dsc->show_stats |= 1ul << (match_statistic ());
-                 if (dsc->show_stats == DSC_NONE)
-                   dsc->show_stats = DEFAULT_STATS;
-               }
+               dsc->show_stats |= 1ul << (match_statistic ());
               lex_match (',');
             }
           if (dsc->show_stats == 0)
@@ -486,7 +483,7 @@ generate_z_varname (struct dsc_proc *dsc, char *z_name,
   /* Try a name based on the original variable name. */
   name[0] = 'Z';
   strcpy (name + 1, var_name);
-  name[8] = '\0';
+  name[SHORT_NAME_LEN] = '\0';
   if (try_name (dsc, name))
     {
       strcpy (z_name, name);