From: John Tsiombikas Date: Mon, 22 Aug 2016 11:36:10 +0000 (+0300) Subject: fixed crash if directory has no files X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=commitdiff_plain;h=c4c8a37741c6b59dc512cfaacca6fd593dab96fe fixed crash if directory has no files --- diff --git a/src/fs.cc b/src/fs.cc index c7df966..8aec1b0 100644 --- a/src/fs.cc +++ b/src/fs.cc @@ -122,7 +122,7 @@ void draw_fs() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); int nchildren = (int)cur_node->children.size(); - int ncols = std::min(cur_node->nfiles, max_ncols); + int ncols = std::max(std::min(cur_node->nfiles, max_ncols), 1); int first = start_child % ncols; int col = 0, row = 0;