Bläddra i källkod

detail (missing cast to unsigned char when converting char to int)

Roberto Ierusalimschy 14 år sedan
förälder
incheckning
cf0562e1e7
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      lobject.c

+ 2 - 2
lobject.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lobject.c,v 2.48 2011/05/03 16:01:57 roberto Exp roberto $
+** $Id: lobject.c,v 2.49 2011/05/31 18:24:36 roberto Exp roberto $
 ** Some generic functions over Lua objects
 ** Some generic functions over Lua objects
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -105,7 +105,7 @@ static int isneg (const char **s) {
 
 
 static lua_Number readhexa (const char **s, lua_Number r, int *count) {
 static lua_Number readhexa (const char **s, lua_Number r, int *count) {
   while (lisxdigit(cast_uchar(**s))) {  /* read integer part */
   while (lisxdigit(cast_uchar(**s))) {  /* read integer part */
-    r = (r * 16.0) + (double)luaO_hexavalue(*(*s)++);
+    r = (r * 16.0) + cast_num(luaO_hexavalue(cast_uchar(*(*s)++)));
     (*count)++;
     (*count)++;
   }
   }
   return r;
   return r;