You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-13 01:00:23 +02:00
Rename strPtr()/strPtrNull() to strZ()/strZNull().
We use the Z suffix in many functions to indicate that we are expecting a zero-terminated string so make this function conform to the pattern. As a bonus the new name is a bit shorter, which is a good quality in a commonly-used function.
This commit is contained in:
@ -47,7 +47,7 @@ cmdBegin(bool logOption)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
// Basic info on command start
|
||||
String *info = strNewFmt("%s command begin", strPtr(cfgCommandRoleName()));
|
||||
String *info = strNewFmt("%s command begin", strZ(cfgCommandRoleName()));
|
||||
|
||||
if (logOption)
|
||||
{
|
||||
@ -70,8 +70,8 @@ cmdBegin(bool logOption)
|
||||
if (commandParamIdx != 0)
|
||||
strCatFmt(info, ", ");
|
||||
|
||||
if (strchr(strPtr(commandParam), ' ') != NULL)
|
||||
commandParam = strNewFmt("\"%s\"", strPtr(commandParam));
|
||||
if (strchr(strZ(commandParam), ' ') != NULL)
|
||||
commandParam = strNewFmt("\"%s\"", strZ(commandParam));
|
||||
|
||||
strCat(info, commandParam);
|
||||
}
|
||||
@ -123,8 +123,8 @@ cmdBegin(bool logOption)
|
||||
strLstAdd(
|
||||
valueList,
|
||||
strNewFmt(
|
||||
"%s=%s", strPtr(varStr(varLstGet(keyList, keyIdx))),
|
||||
strPtr(varStrForce(kvGet(optionKv, varLstGet(keyList, keyIdx))))));
|
||||
"%s=%s", strZ(varStr(varLstGet(keyList, keyIdx))),
|
||||
strZ(varStrForce(kvGet(optionKv, varLstGet(keyList, keyIdx))))));
|
||||
}
|
||||
}
|
||||
// Generate values for list options
|
||||
@ -146,17 +146,17 @@ cmdBegin(bool logOption)
|
||||
|
||||
strCatFmt(info, " --%s", cfgOptionName(optionId));
|
||||
|
||||
if (strchr(strPtr(value), ' ') != NULL)
|
||||
value = strNewFmt("\"%s\"", strPtr(value));
|
||||
if (strchr(strZ(value), ' ') != NULL)
|
||||
value = strNewFmt("\"%s\"", strZ(value));
|
||||
|
||||
strCatFmt(info, "=%s", strPtr(value));
|
||||
strCatFmt(info, "=%s", strZ(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG(cfgLogLevelDefault(), 0, strPtr(info));
|
||||
LOG(cfgLogLevelDefault(), 0, strZ(info));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
}
|
||||
@ -184,22 +184,22 @@ cmdEnd(int code, const String *errorMessage)
|
||||
String *sckClientStat = sckClientStatStr();
|
||||
|
||||
if (sckClientStat != NULL)
|
||||
LOG_DETAIL(strPtr(sckClientStat));
|
||||
LOG_DETAIL(strZ(sckClientStat));
|
||||
|
||||
// Log tls statistics
|
||||
String *tlsClientStat = tlsClientStatStr();
|
||||
|
||||
if (tlsClientStat != NULL)
|
||||
LOG_DETAIL(strPtr(tlsClientStat));
|
||||
LOG_DETAIL(strZ(tlsClientStat));
|
||||
|
||||
// Log http statistics
|
||||
String *httpClientStat = httpClientStatStr();
|
||||
|
||||
if (httpClientStat != NULL)
|
||||
LOG_INFO(strPtr(httpClientStat));
|
||||
LOG_INFO(strZ(httpClientStat));
|
||||
|
||||
// Basic info on command end
|
||||
String *info = strNewFmt("%s command end: ", strPtr(cfgCommandRoleName()));
|
||||
String *info = strNewFmt("%s command end: ", strZ(cfgCommandRoleName()));
|
||||
|
||||
if (errorMessage == NULL)
|
||||
{
|
||||
@ -211,7 +211,7 @@ cmdEnd(int code, const String *errorMessage)
|
||||
else
|
||||
strCat(info, errorMessage);
|
||||
|
||||
LOG(cfgLogLevelDefault(), 0, strPtr(info));
|
||||
LOG(cfgLogLevelDefault(), 0, strZ(info));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
}
|
||||
|
Reference in New Issue
Block a user