Description: parse -- tpoly
 Correct the tachyon parser for tpoly data files.
Origin: vendor, Debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-10-26

--- a/demosrc/parse.c
+++ b/demosrc/parse.c
@@ -617,6 +617,19 @@
   return PARSENOERR;
 }
 
+static errcode FILEGetVector(FILE * ifp, apivector * v1) {
+  float a, b, c;
+
+  if (fscanf(ifp, "%f %f %f", &a, &b, &c) != 3)
+    return PARSEBADSYNTAX;
+
+  v1->x=a;
+  v1->y=b;
+  v1->z=c;
+
+  return PARSENOERR;
+}
+
 static errcode GetVector(parsehandle * ph, apivector * v1) {
   float a, b, c;
  
@@ -1848,9 +1861,9 @@
     totalpolys++;
     v=0; 
      
-    rc |= GetVector(ph, &v0);
-    rc |= GetVector(ph, &v1);
-    rc |= GetVector(ph, &v2);
+    rc |= FILEGetVector(ifp, &v0);
+    rc |= FILEGetVector(ifp, &v1);
+    rc |= FILEGetVector(ifp, &v2);
 
     Scale3d(&scale, &v0);
     Scale3d(&scale, &v1);
