lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Mar 11, 2009 at 10:54 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
>              if (!isxdigit(cu))
>                luaX_lexerror(ls, "hex escape too short", TK_STRING);
>              if (isdigit(cu))
>                c = 16*c + (cu-'0');
>              else
>                c = 16*c + (cu-'A'+10);
 "The function isxdigit() returns non-zero if its argument is a
hexidecimal digit (i.e. A-F, a-f, or 0-9). Otherwise, zero is
returned. "[1] - your code does not handle the cases of cu being 'a'
through 'f'.

[1] http://www.cppreference.com/wiki/c/string/isxdigit