Migration (Logo): fix --logo-color-num (v2)

This commit is contained in:
李通洲
2023-10-28 23:39:15 +08:00
parent 63032cd840
commit 25849dc4bb
2 changed files with 8 additions and 1 deletions
+4
View File
@@ -7,6 +7,10 @@ const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair p
void ffPrintJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc);
void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFModuleArgs* defaultModuleArgs, FFModuleArgs* moduleArgs);
yyjson_api_inline yyjson_mut_val* yyjson_mut_strbuf(yyjson_mut_doc *doc, const FFstrbuf* buf) {
return yyjson_mut_strncpy(doc, buf->chars, buf->length);
}
yyjson_api_inline bool yyjson_mut_obj_add_strbuf(yyjson_mut_doc *doc,
yyjson_mut_val *obj,
const char *_key,
+4 -1
View File
@@ -473,7 +473,10 @@ void ffOptionsGenerateLogoJsonConfig(FFOptionsLogo* options, yyjson_mut_doc* doc
for (int i = 0; i < FASTFETCH_LOGO_MAX_COLORS; i++)
{
if (!ffStrbufEqual(&options->colors[i], &defaultOptions.colors[i]))
yyjson_mut_obj_add_strbuf(doc, color, (const char [2]) { (char)('1' + i) }, &options->colors[i]);
{
char c = (char)('1' + i);
yyjson_mut_obj_add(color, yyjson_mut_strncpy(doc, &c, 1), yyjson_mut_strbuf(doc, &options->colors[i]));
}
}
if (yyjson_mut_obj_size(color) > 0)
yyjson_mut_obj_add_val(doc, obj, "color", color);