projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* format.c (measure_is_valid): Really return false when m >=
[pspp-builds.git]
/
src
/
data
/
sys-file-reader.c
diff --git
a/src/data/sys-file-reader.c
b/src/data/sys-file-reader.c
index 0a040af60f5072dc604e2aad585c395e82951600..296d53b889b62e50773312f59a009c3fdc128d5a 100644
(file)
--- a/
src/data/sys-file-reader.c
+++ b/
src/data/sys-file-reader.c
@@
-66,7
+66,7
@@
struct sfm_reader
/* Variables. */
struct hsh_table *var_hash;
/* Variables. */
struct hsh_table *var_hash;
- struct variable *
const
*svars;
+ struct variable **svars;
/* File's special constants. */
flt64 sysmis;
/* File's special constants. */
flt64 sysmis;
@@
-510,6
+510,16
@@
sfm_open_reader (struct file_handle *fh, struct dictionary **dict,
assertive_buf_read (r, ¶ms, sizeof(params), 0);
assertive_buf_read (r, ¶ms, sizeof(params), 0);
+ if ( ! measure_is_valid(params.measure)
+ ||
+ ! alignment_is_valid(params.align))
+ {
+ msg(MW,
+ _("%s: Invalid variable display parameters. Default parameters substituted."),
+ fh_get_file_name(r->fh));
+ continue;
+ }
+
v = dict_get_var(*dict, i);
v->measure = params.measure;
v = dict_get_var(*dict, i);
v->measure = params.measure;
@@
-1693,7
+1703,7
@@
sfm_read_case (struct sfm_reader *r, struct ccase *c)
if ( ! r->svars )
{
if ( ! r->svars )
{
- r->svars = (struct variable *
const
*) hsh_data(r->var_hash);
+ r->svars = (struct variable **) hsh_data(r->var_hash);
sort(r->svars, hsh_count(r->var_hash),
sizeof(*r->svars), compare_var_index, 0);
}
sort(r->svars, hsh_count(r->var_hash),
sizeof(*r->svars), compare_var_index, 0);
}