From 31d2ae8936d48976fcf3a4f017ace6410f27136f Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 21 Oct 2018 21:37:18 +0300 Subject: util.h: make step const --- src/util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 79a7e7e..1c345e8 100644 --- a/src/util.h +++ b/src/util.h @@ -33,7 +33,8 @@ static inline void for_each_line_in_file(FILE *f, void (*cb)(const char *line, void *data), void *data) { char *buffer = NULL; - size_t step = 1024, allocated = 0, written = 0, read = 0; + const size_t step = 1024; + size_t allocated = 0, written = 0, read = 0; do { if (written + read >= allocated && !(buffer = realloc(buffer, (allocated += step) + 1))) err(EXIT_FAILURE, "realloc"); -- cgit v1.2.3