1.1 --- a/src/core/android/SDL_android.cpp Fri Oct 14 17:29:49 2011 +0100
1.2 +++ b/src/core/android/SDL_android.cpp Sat Oct 15 14:16:29 2011 -0700
1.3 @@ -23,8 +23,6 @@
1.4
1.5 #include "SDL_android.h"
1.6
1.7 -#include <algorithm>
1.8 -
1.9 extern "C" {
1.10 #include "../../events/SDL_events_c.h"
1.11 #include "../../video/android/SDL_androidkeyboard.h"
1.12 @@ -521,8 +519,11 @@
1.13
1.14 // The easy case where we're seeking forwards
1.15 while (movement > 0) {
1.16 - size_t result = Android_JNI_FileRead(ctx, buffer, 1,
1.17 - std::min(movement, (long)sizeof(buffer)));
1.18 + long amount = (long) sizeof (buffer);
1.19 + if (amount > movement) {
1.20 + amount = movement;
1.21 + }
1.22 + size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
1.23
1.24 if (result <= 0) {
1.25 // Failed to read/skip the required amount, so fail