mojoshader_preprocessor.c
changeset 950 dcbf30c07fc9
parent 949 356f04114580
child 951 6ef73d06ecb0
--- a/mojoshader_preprocessor.c	Thu Nov 11 04:20:31 2010 -0500
+++ b/mojoshader_preprocessor.c	Mon Nov 15 17:16:08 2010 -0500
@@ -665,10 +665,11 @@
     if ((okay) && (!push_source(ctx,fname,source,sourcelen,1,NULL)))
         okay = 0;
 
-    if ((okay) && (define_include != NULL))
+    if ((okay) && (define_include_len > 0))
     {
+        assert(define_include != NULL);
         okay = push_source(ctx, "<predefined macros>", define_include,
-                           define_include_len, 1, close_define_include);
+                           define_include_len-1, 1, close_define_include);
     } // if
 
     if (!okay)