Skip to content

Commit c116a5a

Browse files
committed
Chore: uses elvis operators where applicatable
1 parent 8f08273 commit c116a5a

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/common/impl/commandoption.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool ffParseModuleOptions(const char* key, const char* value)
6161
}
6262
fprintf(stderr, "Error: Unsupported module option: %s\n", key);
6363
fputs(" Support of module options has been removed. Please add the flag to the JSON config instead.\n", stderr);
64-
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ? value : "true", value ? "\"" : "");
64+
fprintf(stderr, " Example (demonstration only): `{ \"modules\": [ { \"type\": \"%s\", \"%s\": %s%s%s } ] }`\n", moduleName.chars, jsonKey.chars, value ? "\"" : "", value ?: "true", value ? "\"" : "");
6565
fputs(" See <https://github.com/fastfetch-cli/fastfetch/wiki/Configuration> for more information.\n", stderr);
6666
exit(477);
6767
}

src/detection/gpu/gpu_linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static const char* detectOf(FFlist* gpus, FFstrbuf* buffer, FFstrbuf* drmDir, co
560560

561561
if (!gpu->name.length)
562562
{
563-
ffStrbufSetS(&gpu->name, name ? name : compatible);
563+
ffStrbufSetS(&gpu->name, name ?: compatible);
564564
ffStrbufTrimRightSpace(&gpu->name);
565565
}
566566
if (!gpu->vendor.length && name)

src/logo/logo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ void ffLogoPrintChars(const char* data, bool doColorReplacement)
307307
static void logoApplyColors(const FFlogo* logo, bool replacement)
308308
{
309309
if(instance.config.display.colorTitle.length == 0)
310-
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ? logo->colorTitle : logo->colors[0]);
310+
ffStrbufAppendS(&instance.config.display.colorTitle, logo->colorTitle ?: logo->colors[0]);
311311

312312
if(instance.config.display.colorKeys.length == 0)
313-
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ? logo->colorKeys : logo->colors[1]);
313+
ffStrbufAppendS(&instance.config.display.colorKeys, logo->colorKeys ?: logo->colors[1]);
314314

315315
if (replacement)
316316
{

0 commit comments

Comments
 (0)