u3: fixes bug in snapshot image truncation
@@ -621,7 +621,7 @@ _ce_patch_apply(u3_ce_patch* pat_u)
if ( u3P.nor_u.pgs_w > pat_u->con_u->nor_w ) {
c3_w ret_w;
- ret_w = ftruncate(u3P.nor_u.fid_i, u3P.nor_u.pgs_w << (u3a_page + 2));
+ ret_w = ftruncate(u3P.nor_u.fid_i, pat_u->con_u->nor_w << (u3a_page + 2));
if (ret_w){
fprintf(stderr, "loom: patch apply truncate north: %s\r\n", strerror(errno));
c3_assert(0);
@@ -631,7 +631,7 @@ _ce_patch_apply(u3_ce_patch* pat_u)
if ( u3P.sou_u.pgs_w > pat_u->con_u->sou_w ) {
c3_w ret_w;
- ret_w = ftruncate(u3P.sou_u.fid_i, u3P.sou_u.pgs_w << (u3a_page + 2));
+ ret_w = ftruncate(u3P.sou_u.fid_i, pat_u->con_u->sou_w << (u3a_page + 2));
if (ret_w){
fprintf(stderr, "loom: patch apply truncate south: %s\r\n", strerror(errno));
c3_assert(0);
