]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fsck.c
fsck: Fix a serious bug in prune_mapped_column().
[osl.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index bc77424e30db1f7939ec6b084d707b283b0693ed..f4f1071149e783519f6f0fc6c7acfcf4dcdd0b30 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -553,10 +553,10 @@ static int prune_mapped_column(struct osl_table *t, uint32_t col_num, int fd)
                ret = get_mapped_object(t, col_num, i, &obj);
                if (ret < 0)
                        return ret;
                ret = get_mapped_object(t, col_num, i, &obj);
                if (ret < 0)
                        return ret;
-               ret = _write_all(fd, (char *)(obj.data) - 1, obj.size + 1);
+               ret = _write_all(fd, (char *)(obj.data), obj.size);
                if (ret < 0)
                        return ret;
                if (ret < 0)
                        return ret;
-               written += obj.size + 1;
+               written += obj.size;
                ret = get_row_index(t, i, &index_entry);
                if (ret < 0)
                        return ret;
                ret = get_row_index(t, i, &index_entry);
                if (ret < 0)
                        return ret;