]> source.dussan.org Git - jackcess.git/commitdiff
safer fixed offset handling
authorJames Ahlborn <jtahlborn@yahoo.com>
Fri, 29 May 2009 17:22:23 +0000 (17:22 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Fri, 29 May 2009 17:22:23 +0000 (17:22 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@396 f203690c-595d-4dc9-a70b-905162fa7fd2

src/java/com/healthmarketscience/jackcess/Table.java

index 874f2b0df591194f3b9676a6ce085730a85f3c1f..ecd3edf7cd3af8aa57cee74f50cadbaac91153f6 100644 (file)
@@ -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