| 7348 | |
| 7349 | |
| 7350 | int luaO_str2d (const char *s, lua_Number *result) { |
| 7351 | char *endptr; |
| 7352 | *result = lua_str2number(s, &endptr); |
| 7353 | if (endptr == s) return 0; /* conversion failed */ |
| 7354 | if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ |
| 7355 | *result = cast_num(strtoul(s, &endptr, 16)); |
| 7356 | if (*endptr == '\0') return 1; /* most common case */ |
| 7357 | while (isspace(cast(unsigned char, *endptr))) endptr++; |
| 7358 | if (*endptr != '\0') return 0; /* invalid trailing characters? */ |
| 7359 | return 1; |
| 7360 | } |
| 7361 | |
| 7362 | |
| 7363 |
no outgoing calls
no test coverage detected