fixed another small bug in the FT_Read_xxxx functions (they didn't updated the stream position in the case of disk-based streams. This went un-noticed under Linux which uses memory-mapped files by default)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index c6131d5..0a40fb3 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -285,10 +285,11 @@
else
{
if (stream->pos < stream->size)
- result = stream->base[stream->pos++];
+ result = stream->base[stream->pos];
else
goto Fail;
}
+ stream->pos++;
return result;
Fail:
@@ -327,13 +328,11 @@
}
if (p)
- {
- result = NEXT_Short(p);
- stream->pos += 2;
- }
+ result = NEXT_Short(p);
}
else goto Fail;
+ stream->pos += 2;
return result;
Fail:
@@ -372,13 +371,11 @@
}
if (p)
- {
- result = NEXT_Offset(p);
- stream->pos += 3;
- }
+ result = NEXT_Offset(p);
}
else goto Fail;
+ stream->pos += 3;
return result;
Fail:
@@ -417,13 +414,11 @@
}
if (p)
- {
- result = NEXT_Long(p);
- stream->pos += 4;
- }
+ result = NEXT_Long(p);
}
else goto Fail;
+ stream->pos += 4;
return result;
Fail: