aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xwrap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index cfd17219..2f47ac66 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -1066,13 +1066,14 @@ char *xgetline(FILE *fp, int *len)
{
char *new = 0;
size_t linelen = 0;
+ long ll;
errno = 0;
- if (1>(linelen = getline(&new, &linelen, fp))) {
+ if (1>(ll = getline(&new, &linelen, fp))) {
if (errno) perror_msg("getline");
new = 0;
} else if (new[linelen-1] == '\n') new[--linelen] = 0;
- if (len) *len = linelen;
+ if (len) *len = ll;
return new;
}