]> granicus.if.org Git - yasm/commitdiff
errwarn.c (yasm_warn_fetch): Follow documentation and don't crash if no
authorPeter Johnson <peter@tortall.net>
Tue, 21 Nov 2006 08:54:05 +0000 (08:54 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 21 Nov 2006 08:54:05 +0000 (08:54 -0000)
warnings pending and this is called.

svn path=/trunk/yasm/; revision=1695

libyasm/errwarn.c

index b1f94a012a739fdf0e8983e30b2089b832b8f0c2..6825a3d92823eabc08f91421f97f11e3149e53f7 100644 (file)
@@ -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;