X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsys-file-reader.c;h=9ec176f09f494f9562548918db80b61b31fa36f1;hb=8080fdb87f96b96ae07ef902e7912a23beea49c7;hp=00db5b2f9594da4cc95ca47634c97826eb0e8b8b;hpb=e24089bbe924045c7b98e4bbcc0dc1c4b8703429;p=pspp diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 00db5b2f95..9ec176f09f 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -1052,16 +1052,15 @@ parse_format_spec (struct sfm_reader *r, off_t pos, unsigned int format, uint8_t w = format >> 8; uint8_t d = format; struct fmt_spec f; - bool ok; - if (!fmt_from_io (raw_type, &f.type)) - sys_error (r, pos, _("Unknown variable format %"PRIu8"."), raw_type); f.w = w; f.d = d; msg_disable (); - ok = fmt_check_output (&f) && fmt_check_width_compat (&f, var_get_width (v)); + ok = (fmt_from_io (raw_type, &f.type) + && fmt_check_output (&f) + && fmt_check_width_compat (&f, var_get_width (v))); msg_enable (); if (ok) @@ -1071,14 +1070,20 @@ parse_format_spec (struct sfm_reader *r, off_t pos, unsigned int format, else var_set_write_format (v, &f); } + else if (format == 0) + { + /* Actually observed in the wild. No point in warning about it. */ + } else if (++*n_warnings <= max_warnings) { - char fmt_string[FMT_STRING_LEN_MAX + 1]; - sys_warn (r, pos, _("%s variable %s has invalid %s format %s."), - var_is_numeric (v) ? _("Numeric") : _("String"), - var_get_name (v), - which == PRINT_FORMAT ? _("print") : _("write"), - fmt_to_string (&f, fmt_string)); + if (which == PRINT_FORMAT) + sys_warn (r, pos, _("Variable %s with width %d has invalid print " + "format 0x%x."), + var_get_name (v), var_get_width (v), format); + else + sys_warn (r, pos, _("Variable %s with width %d has invalid write " + "format 0x%x."), + var_get_name (v), var_get_width (v), format); if (*n_warnings == max_warnings) sys_warn (r, -1, _("Suppressing further invalid format warnings."));