From c4c8a37741c6b59dc512cfaacca6fd593dab96fe Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Mon, 22 Aug 2016 14:36:10 +0300 Subject: [PATCH] fixed crash if directory has no files --- src/fs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 1.7.10.4