Merge pull request #49 from polch/master_fixes fix linenoiseEdit buflen decreasing.
diff --git a/linenoise.c b/linenoise.c
index d0e3b0d..5d01c1d 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -663,8 +663,8 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen,
l.history_index = 0;
/* Buffer starts empty. */
- buf[0] = '\0';
- buflen--; /* Make sure there is always space for the nulterm */
+ l.buf[0] = '\0';
+ l.buflen--; /* Make sure there is always space for the nulterm */
/* The latest history entry is always our current buffer, that
* initially is just an empty string. */