From c2bfafe4d88bfd89059cc0a23c1b99f8f679c220 Mon Sep 17 00:00:00 2001 From: "Zooko O'Whielacronx zooko@zooko.com" <zooko@zooko.com> Date: Thu, 1 Feb 2007 04:23:16 +0530 Subject: [PATCH] pyfec: loosen preconditions -- you can have up to 256 total shares, not up to 255 total shares darcs-hash:e3fd6ce669c3b6b821c44151162ef37a6f713a5b --- pyfec/fec/_fecmodule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfec/fec/_fecmodule.c b/pyfec/fec/_fecmodule.c index d597753..e3d68c5 100644 --- a/pyfec/fec/_fecmodule.c +++ b/pyfec/fec/_fecmodule.c @@ -110,8 +110,8 @@ Encoder_init(Encoder *self, PyObject *args, PyObject *kwdict) { py_raise_fec_error("Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", self->mm); return -1; } - if (self->mm > 256) { - py_raise_fec_error("Precondition violation: second argument is required to be less than or equal to 256, but it was %d", self->mm); + if (self->mm > 255) { + py_raise_fec_error("Precondition violation: second argument is required to be less than or equal to 255, but it was %d", self->mm); return -1; } if (self->kk > self->mm) { @@ -363,8 +363,8 @@ Decoder_init(Encoder *self, PyObject *args, PyObject *kwdict) { py_raise_fec_error("Precondition violation: second argument is required to be greater than or equal to 1, but it was %d", self->mm); return -1; } - if (self->mm > 256) { - py_raise_fec_error("Precondition violation: second argument is required to be less than or equal to 256, but it was %d", self->mm); + if (self->mm > 255) { + py_raise_fec_error("Precondition violation: second argument is required to be less than or equal to 255, but it was %d", self->mm); return -1; } if (self->kk > self->mm) { -- 2.45.2