1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00
freebsd-ports/misc/mc-light/files/patch-src-dlglist.c
Roman Bogorodskiy e2c8df6d62 Fix segfault on "mc -v /some/file".
PR:		82766
Submitted by:	Andrej Zverev <az@inec.ru>
Approved by:	Roman Y. Bogdanov (maintainer)
2005-06-29 18:08:19 +00:00

12 lines
598 B
C

--- src/dlglist.c.orig Tue Aug 24 18:14:12 2004
+++ src/dlglist.c Wed Jun 29 11:13:07 2005
@@ -71,7 +71,7 @@
#define mc_list_previous(list) ((list) ? (((MC_DLG_List *)(list))->prev) : NULL)
#define mc_list_next(list) ((list) ? (((MC_DLG_List *)(list))->next) : NULL)
-static MC_DLG_List* mc_list_first (MC_DLG_List *list){ while(list->prev) list=list->prev; return list;}
+static MC_DLG_List* mc_list_first (MC_DLG_List *list){ while(list && list->prev) list=list->prev; return list;}
static MC_DLG_List* mc_list_last (MC_DLG_List *list){ while(list->next) list=list->next; return list;}