]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/ff-string.c
Doc: Documented growing arrays, generic allocators and related things
[libucw.git] / ucw / ff-string.c
index 366092bf7568a90193bf0f55e097ecfc5dcacbec..ed7815bc7028c472022feb057302d09a42577e12 100644 (file)
@@ -8,10 +8,10 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
-#include "ucw/mempool.h"
-#include "ucw/bbuf.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
+#include <ucw/mempool.h>
+#include <ucw/bbuf.h>
 
 char *                                 /* Non-standard */
 bgets(struct fastbuf *f, char *b, uns l)
@@ -35,7 +35,7 @@ bgets(struct fastbuf *f, char *b, uns 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);
@@ -114,7 +114,7 @@ bgets_bb(struct fastbuf *f, struct bb_t *bb, uns 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;
@@ -212,7 +212,7 @@ bgets0(struct fastbuf *f, char *b, uns 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);