Minor i18n issues.
[pspp-builds.git] / src / data / sys-file-reader.c
index 0a040af60f5072dc604e2aad585c395e82951600..296d53b889b62e50773312f59a009c3fdc128d5a 100644 (file)
@@ -66,7 +66,7 @@ struct sfm_reader
 
   /* Variables. */
   struct hsh_table *var_hash;
-  struct variable *const *svars;
+  struct variable **svars;
 
   /* File's special constants. */
   flt64 sysmis;
@@ -510,6 +510,16 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dict,
 
                      assertive_buf_read (r, &params, 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;
@@ -1693,7 +1703,7 @@ sfm_read_case (struct sfm_reader *r, struct ccase *c)
 
   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);
     }