From: uz Date: Mon, 17 Sep 2012 15:09:39 +0000 (+0000) Subject: Fixed a bug reported by thefox: The .CHARMAP command must not accept indices X-Git-Tag: V2.14~247 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e6b52ee8d07a80b03e1843f2be3d4d6b7e5d90d7;p=cc65 Fixed a bug reported by thefox: The .CHARMAP command must not accept indices or character codes with a value of zero. The assembler runs into a CHECK in tgttrans anyway if the index is zero. git-svn-id: svn://svn.cc65.org/cc65/trunk@5826 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index 3318628ad..4bafb8626 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -626,7 +626,7 @@ static void DoCharMap (void) /* Read the index as numerical value */ Index = ConstExpression (); - if (Index < 0 || Index > 255) { + if (Index <= 0 || Index > 255) { /* Value out of range */ ErrorSkip ("Range error"); return; @@ -637,7 +637,7 @@ static void DoCharMap (void) /* Read the character code */ Code = ConstExpression (); - if (Code < 0 || Code > 255) { + if (Code <= 0 || Code > 255) { /* Value out of range */ ErrorSkip ("Range error"); return;