1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Specify size for helpData array.

This commit is contained in:
David Steele
2021-09-19 20:32:27 -04:00
parent 912a498b0b
commit 95d814cf81

View File

@ -288,14 +288,15 @@ Output buffer to a file as a byte array
static void static void
bldHlpRenderHelpAutoC(const Storage *const storageRepo, const BldCfg bldCfg, const BldHlp bldHlp) bldHlpRenderHelpAutoC(const Storage *const storageRepo, const BldCfg bldCfg, const BldHlp bldHlp)
{ {
// Convert pack to bytes // Convert buffer to bytes
const Buffer *const buffer = bldHlpRenderHelpAutoCCmp(bldCfg, bldHlp);
String *const help = strNewFmt( String *const help = strNewFmt(
"%s" "%s"
"static const unsigned char helpData[] =\n" "static const unsigned char helpData[%zu] =\n"
"{\n", "{\n",
strZ(bldHeader("help", "Help Data"))); strZ(bldHeader("help", "Help Data")), bufUsed(buffer));
const Buffer *const buffer = bldHlpRenderHelpAutoCCmp(bldCfg, bldHlp);
bool first = true; bool first = true;
size_t lineSize = 0; size_t lineSize = 0;
char byteZ[4]; char byteZ[4];