Skip to content

Commit

Permalink
Merge pull request #2102 from fingolfin/mh/fmpz_poly_sub_fmpz-crash
Browse files Browse the repository at this point in the history
Fix crash in fmpz_poly_sub_fmpz
  • Loading branch information
albinahlback authored Oct 27, 2024
2 parents 8ed328a + f46c67c commit b197a2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fmpz_poly/sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void fmpz_poly_si_sub(fmpz_poly_t res, slong c, const fmpz_poly_t poly)

if (c < 0)
fmpz_sub_ui(res->coeffs + 0, res->coeffs + 0, -c);
else
else
fmpz_add_ui(res->coeffs + 0, res->coeffs + 0, c);

_fmpz_poly_normalise(res);
Expand All @@ -87,7 +87,7 @@ void fmpz_poly_sub_fmpz(fmpz_poly_t res, const fmpz_poly_t poly, fmpz_t c)
if (poly->length == 0)
{
fmpz_poly_set_fmpz(res, c);
fmpz_neg(res->coeffs + 0, res->coeffs + 0);
fmpz_poly_neg(res, res);
}
else
{
Expand Down

0 comments on commit b197a2e

Please sign in to comment.