]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/ff-string.c
Resources: Added mempool class
[libucw.git] / ucw / ff-string.c
index 366092bf7568a90193bf0f55e097ecfc5dcacbec..e3cb33da86270d3a2af1bdcf9e88c67d3faf745a 100644 (file)
@@ -35,7 +35,7 @@ bgets(struct fastbuf *f, char *b, uns l)
          *b++ = v;
        }
       if (unlikely(cnt == l))
          *b++ = v;
        }
       if (unlikely(cnt == l))
-        die("%s: Line too long", f->name);
+        bthrow(f, "toolong", "%s: Line too long", f->name);
       l -= cnt;
       bdirect_read_commit(f, src);
       src_len = bdirect_read_prepare(f, &src);
       l -= cnt;
       bdirect_read_commit(f, src);
       src_len = bdirect_read_prepare(f, &src);
@@ -114,7 +114,7 @@ bgets_bb(struct fastbuf *f, struct bb_t *bb, uns limit)
       if (cnt == buf_len)
         {
          if (unlikely(len == limit))
       if (cnt == buf_len)
         {
          if (unlikely(len == limit))
-            die("%s: Line too long", f->name);
+            bthrow(f, "toolong", "%s: Line too long", f->name);
          bb_do_grow(bb, len + 1);
          buf = bb->ptr + len;
          buf_len = MIN(bb->len, limit) - len;
          bb_do_grow(bb, len + 1);
          buf = bb->ptr + len;
          buf_len = MIN(bb->len, limit) - len;
@@ -212,7 +212,7 @@ bgets0(struct fastbuf *f, char *b, uns l)
          b++;
        }
       if (unlikely(cnt == l))
          b++;
        }
       if (unlikely(cnt == l))
-        die("%s: Line too long", f->name);
+        bthrow(f, "toolong", "%s: Line too long", f->name);
       l -= cnt;
       bdirect_read_commit(f, src);
       src_len = bdirect_read_prepare(f, &src);
       l -= cnt;
       bdirect_read_commit(f, src);
       src_len = bdirect_read_prepare(f, &src);