summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-10-21 21:37:18 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-10-21 21:51:56 +0300
commit31d2ae8936d48976fcf3a4f017ace6410f27136f (patch)
tree7df92f0f34a076f3676d6e3673a76701b259b231
parent04646db1bf7dee24d6063d61fc320e896ba36941 (diff)
util.h: make step const
-rw-r--r--src/util.h3
1 files changed, 2 insertions, 1 deletions
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");