pspp-dev
[Top][All Lists]
Advanced

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

[patch #6650] one pass covariance algorithm


From: John Darrington
Subject: [patch #6650] one pass covariance algorithm
Date: Tue, 14 Oct 2008 11:32:59 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2)

Follow-up Comment #2, patch #6650 (project pspp):

Also, I'm a bit suspicious over this code:

  if (var_is_alpha (v_max) && var_is_alpha (v_min))
    {
      char *x = xnmalloc (2 * MAX_SHORT_STRING, sizeof (*x));
      strncpy (x, val_max->s, MAX_SHORT_STRING);
      strncat (x, val_min->s, MAX_SHORT_STRING);
      return (*n_vars * (*n_vars + 1 + idx_max)
              + idx_min 
              + hsh_hash_string (x));
    }

1.  It leaks memory.

2.  It won't work properly for long strings.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?6650>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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