From e0f4ae3ffb2d507c9c2fda45e0815b778a0b0729 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 21 Nov 2006 08:54:05 +0000 Subject: [PATCH] errwarn.c (yasm_warn_fetch): Follow documentation and don't crash if no warnings pending and this is called. svn path=/trunk/yasm/; revision=1695 --- libyasm/errwarn.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index b1f94a01..6825a3d9 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -377,6 +377,12 @@ yasm_warn_fetch(yasm_warn_class *wclass, char **str) { warn *w = STAILQ_FIRST(&yasm_warns); + if (!w) { + *wclass = YASM_WARN_NONE; + *str = NULL; + return; + } + *wclass = w->wclass; *str = w->wstr; -- 2.40.0