MCPcopy Create free account
hub / github.com/OpenIPC/firmware / parse_long

Function parse_long

general/package/netblink/src/netblink.c:160–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158/* ── Argument parsing helpers ─────────────────────────────────── */
159
160static int parse_long(const char *str, long *out) {
161 char *end;
162 errno = 0;
163 long val = strtol(str, &end, 10);
164 if (errno != 0 || end == str || *end != '\0') return -1;
165 *out = val;
166 return 0;
167}
168
169/* Allow only chars safe for shell (letters, digits, '.', '-', ':') */
170static int is_safe_host(const char *host) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected