diff --git a/rencode/_rencode.pyx b/rencode/_rencode.pyx index 9796b7e..010792c 100644 --- a/rencode/_rencode.pyx +++ b/rencode/_rencode.pyx @@ -73,7 +73,7 @@ cdef enum: STR_FIXED_COUNT = 64 # Lists with length embedded in typecode. LIST_FIXED_START = STR_FIXED_START+STR_FIXED_COUNT - LIST_FIXED_COUNT = 64 + LIST_FIXED_COUNT = 63 cdef char _float_bits @@ -163,7 +163,7 @@ cdef encode_char(char **buf, unsigned int *pos, signed char x): write_buffer_char(buf, pos, INT_POS_FIXED_START + x) elif -INT_NEG_FIXED_COUNT <= x < 0: write_buffer_char(buf, pos, INT_NEG_FIXED_START - 1 - x) - elif -128 <= x < 128: + elif -128 <= x < 127: write_buffer_char(buf, pos, CHR_INT1) write_buffer_char(buf, pos, x)