1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +02:00

Add strCatZ().

strCat() did not follow our convention of appending Z to functions that accept zero-terminated strings rather than String objects.

Add strCatZ() to accept zero-terminated strings and update strCat() to accept String objects.

Use LF_STR where appropriate but don't use other String constants because they do not improve readability.
This commit is contained in:
David Steele
2020-06-24 12:09:24 -04:00
committed by GitHub
parent dab00e2010
commit 45d9b03136
29 changed files with 161 additions and 145 deletions

View File

@ -73,7 +73,7 @@ cmdBegin(bool logOption)
if (strchr(strPtr(commandParam), ' ') != NULL)
commandParam = strNewFmt("\"%s\"", strPtr(commandParam));
strCat(info, strPtr(commandParam));
strCat(info, commandParam);
}
strCatFmt(info, "]");
@ -203,13 +203,13 @@ cmdEnd(int code, const String *errorMessage)
if (errorMessage == NULL)
{
strCat(info, "completed successfully");
strCatZ(info, "completed successfully");
if (cfgOptionValid(cfgOptLogTimestamp) && cfgOptionBool(cfgOptLogTimestamp))
strCatFmt(info, " (%" PRIu64 "ms)", timeMSec() - timeBegin);
}
else
strCat(info, strPtr(errorMessage));
strCat(info, errorMessage);
LOG(cfgLogLevelDefault(), 0, strPtr(info));
}