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

Function validateProcTitleTemplate

src/server.cpp:7146–7154  ·  view source on GitHub ↗

Validate the specified template, returns 1 if valid or 0 otherwise. */

Source from the content-addressed store, hash-verified

7144}
7145/* Validate the specified template, returns 1 if valid or 0 otherwise. */
7146int validateProcTitleTemplate(const char *_template) {
7147 int ok = 1;
7148 sds res = expandProcTitleTemplate(_template, "");
7149 if (!res)
7150 return 0;
7151 if (sdslen(res) == 0) ok = 0;
7152 sdsfree(res);
7153 return ok;
7154}
7155
7156int redisSetProcTitle(const char *title) {
7157#ifdef USE_SETPROCTITLE

Callers 1

isValidProcTitleTemplateFunction · 0.85

Calls 3

expandProcTitleTemplateFunction · 0.85
sdslenFunction · 0.85
sdsfreeFunction · 0.85

Tested by

no test coverage detected