diff options
| -rw-r--r-- | src/mwindow.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mwindow.c b/src/mwindow.c index 39f6aeacc..f657d9d34 100644 --- a/src/mwindow.c +++ b/src/mwindow.c @@ -211,13 +211,15 @@ unsigned char *git_mwindow_open( git_mwindow_ctl *ctl = &GIT_GLOBAL->mem_ctl; git_mwindow *w = *cursor; - if (!w || !git_mwindow_contains(w, offset + extra)) { + if (!w || !(git_mwindow_contains(w, offset) && + git_mwindow_contains(w, offset + extra))) { if (w) { w->inuse_cnt--; } for (w = mwf->windows; w; w = w->next) { - if (git_mwindow_contains(w, offset + extra)) + if (git_mwindow_contains(w, offset) && + git_mwindow_contains(w, offset + extra)) break; } @@ -242,7 +244,6 @@ unsigned char *git_mwindow_open( } offset -= w->offset; - assert(git__is_sizet(offset)); if (left) *left = (unsigned int)(w->window_map.len - offset); |
