summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-getline.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-getline.c')
-rw-r--r--openbsd-compat/bsd-getline.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/bsd-getline.c b/openbsd-compat/bsd-getline.c
index 681062e80..d676f4cef 100644
--- a/openbsd-compat/bsd-getline.c
+++ b/openbsd-compat/bsd-getline.c
@@ -53,9 +53,9 @@ getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp)
53 53
54 54
55 if (*buf == NULL || *bufsiz == 0) { 55 if (*buf == NULL || *bufsiz == 0) {
56 *bufsiz = BUFSIZ; 56 if ((*buf = malloc(BUFSIZ)) == NULL)
57 if ((*buf = malloc(*bufsiz)) == NULL)
58 return -1; 57 return -1;
58 *bufsiz = BUFSIZ;
59 } 59 }
60 60
61 for (ptr = *buf, eptr = *buf + *bufsiz;;) { 61 for (ptr = *buf, eptr = *buf + *bufsiz;;) {