X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmarc_read_iso2709.c;h=54d865354e8d119e0d6c96d136025fa23334636c;hb=fa4ce7352686da3893b47fde6e295cd4f558f014;hp=249ba424ccb89290a9ae43dc9bda2702d1a82c1c;hpb=4a23f09ebdcc59ef94e50d385cc5b17f42d8845d;p=yaz-moved-to-github.git diff --git a/src/marc_read_iso2709.c b/src/marc_read_iso2709.c index 249ba42..54d8653 100644 --- a/src/marc_read_iso2709.c +++ b/src/marc_read_iso2709.c @@ -177,7 +177,8 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize) buf[i] != ISO2709_RS && buf[i] != ISO2709_IDFS && buf[i] != ISO2709_FS) i++; - yaz_marc_add_subfield(mt, buf+code_offset, i - code_offset); + if (i > code_offset) + yaz_marc_add_subfield(mt, buf+code_offset, i - code_offset); } } else @@ -206,6 +207,7 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab