diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-09 19:43:34 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-09 20:50:45 -0300 |
commit | c9852501a4e1c92dafb35f81f337cb653f8bf501 (patch) | |
tree | 33f5733d7eddc471ee00551c5ad7d06933d9e826 /platform/android | |
parent | d199ed344dbe1d221849db46e6823efc72754b2d (diff) |
Fix bug related to EOF in Android FileAccess
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/file_access_android.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index 885c0f3806..7a038cca64 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -132,12 +132,18 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const { off_t r = AAsset_read(a,p_dst,p_length); + + if (pos+p_length >len ) { + eof=true; + } + if (r>=0) { + pos+=r; if (pos>len) { pos=len; - eof=true; } + } return r; |