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/



_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to