summaryrefslogtreecommitdiffstats
path: root/tests/016/conv.tl
Commit message (Collapse)AuthorAgeFilesLines
* int-str: 0x bug.Kaz Kylheku2021-08-131-0/+50
* lib.c (int_str): The problem here is that we are recognizing and skipping the 0x prefix for all bases. So for instance (int-str "0x123") produces 123. The correct requirement, and the intent of the code, is that the C conventions are only honored if the base is specified as the character #\c. In any other base, including omitted base defaulting to 10, a leading zero is just a leading zero, and 0x is a zero followed by the junk character x. Therefore, if we have any valid base that isn't #\c, and 0x has been seen, we must return zero. We must not do this only in the base 16 case. * tests/016/conv.tl: New file.