[AD] patch for a crash in makedoc

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


   The following patch fixes a makedoc crash occurring when no erefs are
found in the source file.

-- 
Sam.
Index: docs/src/makedoc/makehtml.c
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/makedoc/makehtml.c,v
retrieving revision 1.29
diff -u -r1.29 makehtml.c
--- docs/src/makedoc/makehtml.c	15 May 2004 16:12:37 -0000	1.29
+++ docs/src/makedoc/makehtml.c	9 Aug 2004 22:12:10 -0000
@@ -64,7 +64,7 @@
 static FILE *_file;
 static char _filename[1024];
 static char *_xref[256], *_eref[256];
-static char *_full_eref_list;
+static char *_full_eref_list = NULL;
 static int _xrefs, _erefs;
 static int _empty_count;
 static char *_word_substitution[256];
@@ -1396,7 +1396,7 @@
 	    continue;
 	 tok++;
 	 /* filter normal tokens from the example list */
-	 if (strstr(_full_eref_list, tok))
+	 if (_full_eref_list && strstr(_full_eref_list, tok))
 	    continue;
 	 list = m_xrealloc(list, sizeof(char *) * (num + 1));
 	 list[num++] = tok;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/