mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Chore: uses elvis operators where applicatable
This commit is contained in:
@@ -61,7 +61,7 @@ bool ffParseModuleOptions(const char* key, const char* value)
|
||||
}
|
||||
fprintf(stderr, "Error: Unsupported module option: %s\n", key);
|
||||
fputs(" Support of module options has been removed. Please add the flag to the JSON config instead.\n", stderr);
|
||||
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ? value : "true", value ? "\"" : "");
|
||||
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ?: "true", value ? "\"" : "");
|
||||
fputs(" See <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration> for more information.\n", stderr);
|
||||
exit(477);
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ static const char* detectOf(FFlist* gpus, FFstrbuf* buffer, FFstrbuf* drmDir, co
|
||||
|
||||
if (!gpu->name.length)
|
||||
{
|
||||
ffStrbufSetS(&gpu->name, name ? name : compatible);
|
||||
ffStrbufSetS(&gpu->name, name ?: compatible);
|
||||
ffStrbufTrimRightSpace(&gpu->name);
|
||||
}
|
||||
if (!gpu->vendor.length && name)
|
||||
|
||||
+2
-2
@@ -307,10 +307,10 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
|
||||
static void logoApplyColors(const FFlogo* logo, bool replacement)
|
||||
{
|
||||
if(instance.config.display.colorTitle.length == 0)
|
||||
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ? logo->colorTitle : logo->colors[0]);
|
||||
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ?: logo->colors[0]);
|
||||
|
||||
if(instance.config.display.colorKeys.length == 0)
|
||||
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ? logo->colorKeys : logo->colors[1]);
|
||||
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ?: logo->colors[1]);
|
||||
|
||||
if (replacement)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user