mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
Fix off-by-one in linenoise SERVER-3394
This commit is contained in:
parent
f9d784faf0
commit
ff418fdac2
2
third_party/linenoise/linenoise.cpp
vendored
2
third_party/linenoise/linenoise.cpp
vendored
@ -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--;
|
||||
|
Loading…
Reference in New Issue
Block a user