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

Function getnum

third-party/lua-5.4.6/src/lstrlib.c:1449–1459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

getnumlimitFunction · 0.70
getoptionFunction · 0.70

Calls 1

digitFunction · 0.70

Tested by

no test coverage detected