MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getLongInfoField

Function getLongInfoField

src/redis-cli.c:6830–6838  ·  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

6828/* Like the above function but automatically convert the result into
6829 * a long. On error (missing field) LONG_MIN is returned. */
6830static long getLongInfoField(char *info, char *field) {
6831 char *value = getInfoField(info,field);
6832 long l;
6833
6834 if (!value) return LONG_MIN;
6835 l = strtol(value,NULL,10);
6836 zfree(value);
6837 return l;
6838}
6839
6840/* Convert number of bytes into a human readable string of the form:
6841 * 100B, 2G, 100M, 4K, and so forth. */

Callers 4

statModeFunction · 0.85

Calls 2

getInfoFieldFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected