Fix problem reading files a multiple of 128 bytes long (#3280)

This commit is contained in:
Philip Gladstone 2020-09-13 11:37:54 -04:00 committed by GitHub
parent 64bbf00689
commit c000a0894a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -442,6 +442,9 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd )
int nread = vfs_read(fd, p, nwanted); int nread = vfs_read(fd, p, nwanted);
if (nread == VFS_RES_ERR || nread == 0) { if (nread == VFS_RES_ERR || nread == 0) {
if (j > 0) {
break;
}
lua_pushnil(L); lua_pushnil(L);
return 1; return 1;
} }