MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / numpadRangeCheck

Function numpadRangeCheck

switch/source/KeyboardManager.cpp:40–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 int g_numpadMax = 0;
39
40 SwkbdTextCheckResult numpadRangeCheck(char* tmpString, size_t tmpStringSize)
41 {
42 char* end = nullptr;
43 const long value = strtol(tmpString, &end, 10);
44 if (end == tmpString || *end != '\0' || value < g_numpadMin || value > g_numpadMax) {
45 snprintf(tmpString, tmpStringSize, "Enter a value between %d and %d.", g_numpadMin, g_numpadMax);
46 return SwkbdTextCheckResult_Bad;
47 }
48 return SwkbdTextCheckResult_OK;
49 }
50}
51
52KeyboardManager::KeyboardManager(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected