Fixed NULL dereference in debug output.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 06 Mar 2009 23:22:04 -0500
changeset 727 6978fac0fa31
parent 726 9f58e2b0ed8a
child 728 c37993f6f474
Fixed NULL dereference in debug output.
mojoshader_preprocessor.c
--- a/mojoshader_preprocessor.c	Fri Mar 06 23:19:40 2009 -0500
+++ b/mojoshader_preprocessor.c	Fri Mar 06 23:22:04 2009 -0500
@@ -30,7 +30,8 @@
 #if DEBUG_TOKENIZER
 static void print_debug_lexing_position(IncludeState *s)
 {
-    printf("NOW LEXING %s:%d ...\n", s->filename, s->line);
+    if (s != NULL)
+        printf("NOW LEXING %s:%d ...\n", s->filename, s->line);
 } // print_debug_lexing_position
 #else
 #define print_debug_lexing_position(s)