Skip to content

Commit 5a7a11c

Browse files
authored
fix regression in bch.c
1 parent 42d8bbc commit 5a7a11c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ struct gf_poly {
153153

154154
/* polynomial of degree 1 */
155155
struct gf_poly_deg1 {
156-
struct gf_poly poly;
156+
struct {
157+
unsigned int deg;
158+
} poly;
157159
unsigned int c[2];
158160
};
159161

@@ -991,7 +993,7 @@ static void factor_polynomial(struct bch_control *bch, int k, struct gf_poly *f,
991993
/* compute h=f/gcd(f,tk); this will modify f and q */
992994
gf_poly_div(bch, f, gcd, q);
993995
/* store g and h in-place (clobbering f) */
994-
*h = &((struct gf_poly_deg1 *)f)[gcd->deg].poly;
996+
*h = (struct gf_poly *) &((struct gf_poly_deg1 *)f)[gcd->deg].poly;
995997
gf_poly_copy(*g, gcd);
996998
gf_poly_copy(*h, q);
997999
}

0 commit comments

Comments
 (0)