- yaz_marc_add_datafield(mt, tag, buf+i, indicator_length);
- i += indicator_length;
+ if (indicator_length)
+ {
+ /* skip RS/FS bytes in indicator. They are not allowed there */
+ int j;
+ for (j = indicator_length; --j >= 0; )
+ if (buf[j+i] < ' ')
+ {
+ j++;
+ i += j;
+ end_offset += j;
+ yaz_marc_cprintf(mt, "Bad indicator data. "
+ "Skipping %d bytes", j);
+ break;
+ }
+ yaz_marc_add_datafield(mt, tag, buf+i, indicator_length);
+ i += indicator_length;
+ }