]> git.sur5r.net Git - cc65/commitdiff
One less bug in sizeof ("ABC").
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 16 May 2002 17:05:36 +0000 (17:05 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 16 May 2002 17:05:36 +0000 (17:05 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1274 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/expr.c

index c78d98cee6b5fef424e3372e5355a2899abfd0e5..f39b2ce11b2af5cc25bbe2cbf3d7ba415a146636 100644 (file)
@@ -988,7 +988,7 @@ static int primary (ExprDesc* lval)
     if (CurTok.Tok == TOK_SCONST) {
        lval->Flags = E_MCONST | E_TLIT;
                lval->ConstVal = CurTok.IVal;
-       lval->Type  = GetCharArrayType (strlen (GetLiteral (CurTok.IVal)));
+       lval->Type  = GetCharArrayType (GetLiteralPoolOffs () - CurTok.IVal);
        NextToken ();
        return 0;
     }