chiark / gitweb /
record seems to work for dummy case
authorian <ian>
Wed, 13 Feb 2008 00:14:16 +0000 (00:14 +0000)
committerian <ian>
Wed, 13 Feb 2008 00:14:16 +0000 (00:14 +0000)
hostside/record.c

index 0a2041800f2e9c7dd52533145a74549ea665d560..bc2be620f510b86eb5c84a70370fd214a2026446 100644 (file)
@@ -158,7 +158,8 @@ void record_train_step(Train *tra, int step, int speed, int upw, int downw) {
   SpeedCurveEntry *new;
   int i;
   
-  if (curvebufused >= curvebufsz) record_yyerror("more speed points on 2nd pass!");
+  if (curvebufused >= curvebufsz)
+    record_yyerror("more speed points on 2nd pass!");
 
   if (!tra->accel.curve) {
     tra->accel.curve= curvebuf + curvebufused;
@@ -187,7 +188,7 @@ void record_train_step(Train *tra, int step, int speed, int upw, int downw) {
    * out of order speed points. */
 
   new= &tra->accel.curve[tra->accel.curvesz++];
-  curvebufsz++;
+  curvebufused++;
 
   new->step= step;
   new->speed= speed * 1e-6 * SPEED_UNIT;