finderrors.c
changeset 562 c9a2bc5129c9
parent 536 5af65fe6e917
child 577 bec531dd448e
--- a/finderrors.c	Tue Feb 10 17:54:00 2009 -0500
+++ b/finderrors.c	Wed Feb 11 15:43:02 2009 -0500
@@ -71,7 +71,7 @@
     } // if
 
     static unsigned char buf[1024 * 256];
-    int rc = fread(buf, 1, sizeof (buf)-1, io);
+    int rc = fread(buf, 1, sizeof (buf), io);
     fclose(io);
     if (rc == -1)
     {
@@ -84,7 +84,8 @@
         const MOJOSHADER_parseData *a;
 
         buf[rc] = '\0';  // make sure the source is null-terminated.
-        a = MOJOSHADER_assemble((char *) buf, 0, 0, 0, 0, 0, 0, 0);
+        a = MOJOSHADER_assemble((char *) buf, rc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
         if (a->error_count > 0)
         {
             report("FAIL: %s (line %d) %s\n", fname, a->errors[0].error_position, a->errors[0].error);