MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getLongInfoField

Function getLongInfoField

app/redis-6.2.6/src/redis-cli.c:7944–7952  ·  view source on GitHub ↗

Like the above function but automatically convert the result into * a long. On error (missing field) LONG_MIN is returned. */

Source from the content-addressed store, hash-verified

7942/* Like the above function but automatically convert the result into
7943 * a long. On error (missing field) LONG_MIN is returned. */
7944static long getLongInfoField(char *info, char *field) {
7945 char *value = getInfoField(info,field);
7946 long l;
7947
7948 if (!value) return LONG_MIN;
7949 l = strtol(value,NULL,10);
7950 zfree(value);
7951 return l;
7952}
7953
7954/* Convert number of bytes into a human readable string of the form:
7955 * 100B, 2G, 100M, 4K, and so forth. */

Callers 4

statModeFunction · 0.85

Calls 3

getInfoFieldFunction · 0.85
strtolFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected