MARC line reader: allow control fields of size 1
[yaz-moved-to-github.git] / src / marc_read_line.c
index 15ec7a5..eefeb84 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
  */
 
@@ -144,7 +144,7 @@ int yaz_marc_read_line(yaz_marc_t mt,
                                 &length_implementation);
             header_created = 1;
         }
-        else if (line_len > 5 && line[0] != ' ' && line[1] != ' ' 
+        else if (line_len > 4 && line[0] != ' ' && line[1] != ' '
                  && line[2] != ' ' && line[3] == ' ' )
         {
             /* deal with data/control lines: 245 12 ........ */
@@ -231,7 +231,6 @@ int yaz_marc_read_line(yaz_marc_t mt,
                             cp++;
                         }
                     }
-                    assert(len >= 0);
                     yaz_marc_add_subfield(mt, cp, len);
                     if (!next)
                         break;
@@ -253,6 +252,7 @@ int yaz_marc_read_line(yaz_marc_t mt,
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab