diff src/layout.c @ 523:0717bcc4f2b7

Handle the case of reduction of the number of view directory types. Previously it was leading to a segfault.
author zas_
date Fri, 25 Apr 2008 08:07:22 +0000
parents 135570a8bd96
children bf9c9e37adf4
line wrap: on
line diff
--- a/src/layout.c	Thu Apr 24 20:29:09 2008 +0000
+++ b/src/layout.c	Fri Apr 25 08:07:22 2008 +0000
@@ -1913,7 +1913,7 @@
 
 	layout_config_parse(options->layout.style, options->layout.order,
 			    &lw->dir_location,  &lw->file_location, &lw->image_location);
-	lw->dir_view_type = options->layout.dir_view_type;
+	lw->dir_view_type = CLAMP(options->layout.dir_view_type, 0, VIEW_DIR_TYPES_COUNT - 1);
 	lw->icon_view = options->layout.view_as_icons;
 
 	/* divider positions */