diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 60ee8a6f3..134f39d2b 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -379,7 +379,7 @@
         end0 = end;
       }
 
-      if ( end != n_points - 1 )
+      if ( end0 != n_points - 1 )
         goto Bad;
 
       /* XXX: check the tags array */