Logistic Regression syntax generator: replace ds_data with ds_cstr
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 11 Jul 2016 18:51:18 +0000 (20:51 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 11 Jul 2016 18:51:18 +0000 (20:51 +0200)
ds_data does not produce a terminating null.  So garbage could be appended at the end of the command.

Fixes bug #48467

src/ui/gui/psppire-dialog-action-logistic.c

index 6be5ce44c561bbdaae2e3a705cfbf74a2f7ed9f8..4308d9b3492ee0a2dc3b30cb1a1776f2265c4eff 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2008, 2010, 2011, 2012  Free Software Foundation
+   Copyright (C) 2008, 2010, 2011, 2012, 2016  Free Software Foundation
 
    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
@@ -203,7 +203,7 @@ generate_syntax (const PsppireDialogAction *a)
   ds_init_cstr (&opt_str, "\n\t/CRITERIA =");
   syntax_gen_pspp (&opt_str, " CUT(%g)", rd->cut_point);
   syntax_gen_pspp (&opt_str, " ITERATE(%d)", rd->max_iterations);
-  g_string_append (strx, ds_data (&opt_str));
+  g_string_append (strx, ds_cstr (&opt_str));
   ds_destroy (&opt_str);
 
   if (rd->conf)