Browse Source

Fix handling of failed fp:read(..., "*n").

Mike Pall 15 years ago
parent
commit
c7a3103f41
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/lib_io.c

+ 1 - 0
src/lib_io.c

@@ -140,6 +140,7 @@ static int io_file_readnum(lua_State *L, FILE *fp)
     setnumV(L->top++, d);
     setnumV(L->top++, d);
     return 1;
     return 1;
   } else {
   } else {
+    setnilV(L->top++);
     return 0;
     return 0;
   }
   }
 }
 }