diff options
author | Mathias Stearn <mathias@10gen.com> | 2011-09-07 12:24:32 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2011-09-09 13:39:07 -0400 |
commit | ff418fdac2591664a9bb1fe76be854483b136e1c (patch) | |
tree | 5a35605dfab53a50ace92f65a0a3b5bdbd6a981e | |
parent | f9d784faf0f8d6178e2f1758d9b36521ca6acbc8 (diff) | |
download | mongo-ff418fdac2591664a9bb1fe76be854483b136e1c.tar.gz |
Fix off-by-one in linenoise SERVER-3394
-rw-r--r-- | third_party/linenoise/linenoise.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/linenoise/linenoise.cpp b/third_party/linenoise/linenoise.cpp index 8c65417f61f..ce3e3c5b8f3 100644 --- a/third_party/linenoise/linenoise.cpp +++ b/third_party/linenoise/linenoise.cpp @@ -281,7 +281,7 @@ static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_ if (scanDirection) { int unmatched = scanDirection; int i; - for(i = pos + scanDirection; i >= 0 && i <= (int)len; i += scanDirection){ + for(i = pos + scanDirection; i >= 0 && i < (int)len; i += scanDirection){ /* TODO: the right thing when inside a string */ if (strchr("}])", buf[i])) unmatched--; |