Browse Source

lsp_mg_read: remove dead code, return nil on empty read

abadc0de 12 years ago
parent
commit
ce55924a02
1 changed files with 1 additions and 1 deletions
  1. 1 1
      mongoose.c

+ 1 - 1
mongoose.c

@@ -4070,7 +4070,7 @@ static int lsp_mg_read(lua_State *L) {
   char buf[1024];
   int len = mg_read(conn, buf, sizeof(buf));
 
-  lua_settop(L, 0);
+  if (!len) return 0;
   lua_pushlstring(L, buf, len);
 
   return 1;