summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2009-05-29 17:22:23 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2009-05-29 17:22:23 +0000
commit5f0f190e88788ffc6993af5a1129b1ea97674e1c (patch)
tree0580ebe5a5a5eda934df5453eef9eeae909a5860
parent2a058943cfc469997a1ba1c92330e16ed9ccee7f (diff)
downloadjackcess-5f0f190e88788ffc6993af5a1129b1ea97674e1c.tar.gz
jackcess-5f0f190e88788ffc6993af5a1129b1ea97674e1c.zip
safer fixed offset handling
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@396 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r--src/java/com/healthmarketscience/jackcess/Table.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Table.java b/src/java/com/healthmarketscience/jackcess/Table.java
index 874f2b0..ecd3edf 100644
--- a/src/java/com/healthmarketscience/jackcess/Table.java
+++ b/src/java/com/healthmarketscience/jackcess/Table.java
@@ -887,7 +887,8 @@ public class Table
buffer.putShort((short) 0);
} else {
buffer.putShort(fixedOffset);
- fixedOffset += col.getType().getFixedSize();
+ fixedOffset += Math.max(col.getType().getFixedSize(),
+ col.getLength());
}
if(!col.getType().isLongValue()) {
buffer.putShort(col.getLength()); //Column length