mojoshader_preprocessor.c
changeset 643 20403ca72f54
parent 642 624ab8696f9b
child 644 ea8b50a4edaf
--- a/mojoshader_preprocessor.c	Tue Feb 17 08:40:03 2009 -0500
+++ b/mojoshader_preprocessor.c	Tue Feb 17 08:40:34 2009 -0500
@@ -899,8 +899,11 @@
                 break;
 
             case ((Token) ' '):  // may not actually point to ' '.
-                if (!add_to_buffer(&buffer, &space, 1, m, d))
-                    ctx->out_of_memory = 1;
+                if (buffer.total_bytes > 0)
+                {
+                    if (!add_to_buffer(&buffer, &space, 1, m, d))
+                        ctx->out_of_memory = 1;
+                } // if
                 break;
 
             default: