--- src.old/ed.c	2003-04-30 14:00:00.000000000 +0200
+++ src/ed.c	2004-03-24 10:22:06.000000000 +0100
@@ -703,7 +703,7 @@
     from = (from < 1) ? 1 : from;
     to = (to > P_LASTLN) ? P_LASTLN : to;
 
-    if (to != 0)
+    if (to != 0 && from <= P_LASTLN)
     {
         _setCurLn( from );
         while( P_CURLN <= to )
