MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / getnum

Function getnum

third-party/lua-5.5.0/src/lstrlib.c:1453–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1451static int digit (int c) { return '0' <= c && c <= '9'; }
1452
1453static size_t getnum (const char **fmt, size_t df) {
1454 if (!digit(**fmt)) /* no number? */
1455 return df; /* return default value */
1456 else {
1457 size_t a = 0;
1458 do {
1459 a = a*10 + cast_uint(*((*fmt)++) - '0');
1460 } while (digit(**fmt) && a <= (MAX_SIZE - 9)/10);
1461 return a;
1462 }
1463}
1464
1465
1466/*

Callers 2

getnumlimitFunction · 0.70
getoptionFunction · 0.70

Calls 1

digitFunction · 0.70

Tested by

no test coverage detected