MCPcopy Create free account
hub / github.com/antirez/ds4 / test_env_u32

Function test_env_u32

tests/ds4_test.c:21–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 const char *v = getenv(name);
20 return v && v[0] && strcmp(v, "0") != 0;
21}
22
23static uint32_t test_env_u32(const char *name) {
24 const char *v = getenv(name);
25 if (!v || !v[0]) return 0;
26 char *end = NULL;
27 unsigned long n = strtoul(v, &end, 10);
28 if (end == v) return 0;
29 return n > UINT32_MAX ? UINT32_MAX : (uint32_t)n;
30}
31

Callers 1

test_open_engineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected