Fix bug in ROC parsing long string variables
[pspp-builds.git] / src / language / stats / roc.c
index 4cd593a277c97694f2aec420b7e0ecbfd9820005..86aee1f9d1f5e6a9662f1a605ebf560db52b19b7 100644 (file)
@@ -112,6 +112,7 @@ cmd_roc (struct lexer *lexer, struct dataset *ds)
       goto error;
     }
 
+  value_init (&roc.state_value, var_get_width (roc.state_var));
   parse_value (lexer, &roc.state_value, var_get_width (roc.state_var));
 
 
@@ -271,10 +272,12 @@ cmd_roc (struct lexer *lexer, struct dataset *ds)
   if ( ! run_roc (ds, &roc)) 
     goto error;
 
+  value_destroy (&roc.state_value, var_get_width (roc.state_var));
   free (roc.vars);
   return CMD_SUCCESS;
 
  error:
+  value_destroy (&roc.state_value, var_get_width (roc.state_var));
   free (roc.vars);
   return CMD_FAILURE;
 }
@@ -962,9 +965,9 @@ show_auc  (struct roc_state *rs, const struct cmd_roc *roc)
       tab_text (tbl, n_cols - 2, 1, TAT_TITLE, _("Lower Bound"));
       tab_text (tbl, n_cols - 1, 1, TAT_TITLE, _("Upper Bound"));
 
-      tab_joint_text (tbl, n_cols - 2, 0, 4, 0,
-                     TAT_TITLE | TAB_CENTER | TAT_PRINTF,
-                     _("Asymp. %g%% Confidence Interval"), roc->ci);
+      tab_joint_text_format (tbl, n_cols - 2, 0, 4, 0,
+                            TAT_TITLE | TAB_CENTER,
+                            _("Asymp. %g%% Confidence Interval"), roc->ci);
       tab_vline (tbl, 0, n_cols - 1, 0, 0);
       tab_hline (tbl, TAL_1, n_cols - 2, n_cols - 1, 1);
     }