[Top][All Lists]

[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: Gecko/20080404 Iceweasel/ (Debian-

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:


  Message sent via/by Savannah

reply via email to

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