From da0113ce4bdca555a43fcc17e89d2733ee3d399d Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 18 May 2004 20:51:31 +0000 Subject: [PATCH] add sanity check in List_Pop --- DataStr/List.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DataStr/List.cpp b/DataStr/List.cpp index ed1b0989b5..c41069e7f1 100644 --- a/DataStr/List.cpp +++ b/DataStr/List.cpp @@ -1,4 +1,4 @@ -// $Id: List.cpp,v 1.29 2004-02-07 01:40:17 geuzaine Exp $ +// $Id: List.cpp,v 1.30 2004-05-18 20:51:31 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -155,7 +155,8 @@ void List_Put(List_T * liste, int index, void *data) void List_Pop(List_T * liste) { - liste->n--; + if(liste->n > 0) + liste->n--; } void *List_Pointer(List_T * liste, int index) -- GitLab