aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index c09923ba..b144b2f4 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -1050,7 +1050,7 @@ char *xgetline(FILE *fp, int *len)
if (1>(ll = getline(&new, &linelen, fp))) {
if (errno) perror_msg("getline");
new = 0;
- } else if (new[linelen-1] == '\n') new[--linelen] = 0;
+ } else if (new[ll-1] == '\n') new[--ll] = 0;
if (len) *len = ll;
return new;