pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] Changes to pspp/src/list.q


From: Ben Pfaff
Subject: [Pspp-cvs] Changes to pspp/src/list.q
Date: Wed, 26 Oct 2005 01:07:18 -0400

Index: pspp/src/list.q
diff -u pspp/src/list.q:1.18 pspp/src/list.q:1.19
--- pspp/src/list.q:1.18        Mon Oct 24 02:51:32 2005
+++ pspp/src/list.q     Wed Oct 26 05:06:14 2005
@@ -191,9 +191,8 @@
            {
              /* Add the weight variable to the end of the variable list. */
              cmd.n_variables++;
-             cmd.v_variables = xrealloc (cmd.v_variables,
-                                         (cmd.n_variables
-                                          * sizeof *cmd.v_variables));
+             cmd.v_variables = xnrealloc (cmd.v_variables, cmd.n_variables,
+                                           sizeof *cmd.v_variables);
              cmd.v_variables[cmd.n_variables - 1]
                 = dict_get_weight (default_dict);
            }
@@ -215,8 +214,8 @@
 
       /* Add the weight variable at the beginning of the variable list. */
       cmd.n_variables++;
-      cmd.v_variables = xrealloc (cmd.v_variables,
-                                 cmd.n_variables * sizeof *cmd.v_variables);
+      cmd.v_variables = xnrealloc (cmd.v_variables,
+                                   cmd.n_variables, sizeof *cmd.v_variables);
       memmove (&cmd.v_variables[1], &cmd.v_variables[0],
               (cmd.n_variables - 1) * sizeof *cmd.v_variables);
       cmd.v_variables[0] = &casenum_var;
@@ -303,7 +302,7 @@
       size_t x;
       
       /* Allocate, initialize header. */
-      prc->header = xmalloc (sizeof (char *) * prc->header_rows);
+      prc->header = xnmalloc (prc->header_rows, sizeof *prc->header);
       {
        int w = n_chars_width (d);
        for (i = 0; i < prc->header_rows; i++)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]