struct matrix_reader
{
- const struct dictionary *dict;
const struct variable *varname;
const struct variable *rowtype;
struct casegrouper *grouper;
{
struct matrix_reader *mr = xzalloc (sizeof *mr);
- mr->dict = dict;
mr->varname = dict_lookup_var (dict, "varname_");
if (mr->varname == NULL)
{
char s[w];
memset (s, 0, w);
const char *name = var_get_name (vars[i]);
- strcpy (s, name);
+ strncpy (s, name, w);
unsigned long h = hash_bytes (s, w, 0);
table[i] = h;
}
AT_CLEANUP
+
+
+
+
+AT_SETUP([Matrix data (badly formed)])
+
+AT_DATA([data.pspp], [dnl
+data list list /ROWTYPE_ (a8) VARNAME_(a4) v1 v2 v3 v4xxxxxxxxxxxxxxxxxxxxxzzzzzzzzzzzzzxxxxxxxxx.
+begin data
+mean "" 1 2 3 4
+sd "" 5 6 7 8
+n "" 2 3 4 5
+corr v1 11 22 33 44
+corr v2 55 66 77 88
+corr v3 111 222 333 444
+corr v4 4 3 21 1
+end data.
+
+list.
+
+factor matrix=in(corr = *)
+ .
+])
+
+AT_CHECK([pspp -O format=csv data.pspp], [1], [ignore])
+
+AT_CLEANUP
\ No newline at end of file