FREQUENCIES: Fix crash when median and histogram both requested.
[pspp-builds.git] / src / language / stats / frequencies.q
index c00e645f82e9ccd27a05e4a540b2f96e813405e2..9bc2f73e8c57603810a253490841897721a6a9d7 100644 (file)
@@ -1047,7 +1047,7 @@ dump_statistics (const struct frq_proc *frq, const struct var_freqs *vf,
   tab_double (t, 2, 0, TAB_NONE, ft->valid_cases, wfmt);
   tab_double (t, 2, 1, TAB_NONE, ft->total_cases - ft->valid_cases, wfmt);
 
-  for (i = 0; i < frq->n_percentiles; i++, r++)
+  for (i = 0; i < frq->n_percentiles; i++)
     {
       struct percentile *pc = &frq->percentiles[i];
 
@@ -1065,6 +1065,7 @@ dump_statistics (const struct frq_proc *frq, const struct var_freqs *vf,
         tab_fixed (t, 1, r, TAB_LEFT, pc->p * 100, 3, 0);
       tab_double (t, 2, r, TAB_NONE, pc->value,
                   var_get_print_format (vf->var));
+      r++;
     }
 
   tab_title (t, "%s", var_to_string (vf->var));