aboutgitcodebugslistschat
path: root/lineread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lineread.c')
-rw-r--r--lineread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lineread.c b/lineread.c
index 59021e6..6ffb14e 100644
--- a/lineread.c
+++ b/lineread.c
@@ -16,10 +16,10 @@
#include <fcntl.h>
#include <string.h>
#include <stdbool.h>
-#include <assert.h>
#include <unistd.h>
#include "lineread.h"
+#include "util.h"
/**
* lineread_init() - Prepare for line by line file reading without allocation
@@ -44,10 +44,10 @@ static int peek_line(struct lineread *lr, bool eof)
char *nl;
/* Sanity checks (which also document invariants) */
- assert(lr->count >= 0);
- assert(lr->next_line >= 0);
- assert(lr->next_line + lr->count >= lr->next_line);
- assert(lr->next_line + lr->count <= LINEREAD_BUFFER_SIZE);
+ ASSERT(lr->count >= 0);
+ ASSERT(lr->next_line >= 0);
+ ASSERT(lr->next_line + lr->count >= lr->next_line);
+ ASSERT(lr->next_line + lr->count <= LINEREAD_BUFFER_SIZE);
nl = memchr(lr->buf + lr->next_line, '\n', lr->count);