From: Mark Wooding Date: Thu, 1 Sep 2011 23:49:10 +0000 (+0100) Subject: mptext.c: Fix hopeless incorrectness in raw base conversions. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/572b324afecc0a7cb2654caf1967e18c8bd813ec?hp=572b324afecc0a7cb2654caf1967e18c8bd813ec mptext.c: Fix hopeless incorrectness in raw base conversions. Both mp_write and mp_read are broken. The former would write a digit `0' for a zero input, and attempt to prefix its output with a `-' sign on negative input, both of which are impossible to decode unambiguously. The latter would skip leading whitespace characters, which makes encodings beginning with certain bytes decode incorrectly. Include tests for these cases, and fix the bugs. ---