mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
dont use format string if an error occures
This commit is contained in:
+7
-6
@@ -14,16 +14,17 @@ void ffPrintHost(FFinstance* instance)
|
||||
FF_STRBUF_CREATE(version);
|
||||
ffGetFileContent("/sys/devices/virtual/dmi/id/product_version", &version);
|
||||
|
||||
if(family.length == 0 && name.length == 0)
|
||||
{
|
||||
ffPrintError(instance, &instance->config.hostKey, "Host", "neither family nor name could be determined");
|
||||
return;
|
||||
}
|
||||
|
||||
FF_STRBUF_CREATE(host);
|
||||
|
||||
if(instance->config.hostFormat.length == 0)
|
||||
{
|
||||
if(family.length == 0 && name.length == 0)
|
||||
{
|
||||
ffPrintError(instance, &instance->config.hostKey, "Host", "neither family nor name could be determined");
|
||||
return;
|
||||
}
|
||||
else if(name.length == 0)
|
||||
if(name.length == 0)
|
||||
{
|
||||
ffStrbufAppend(&host, &family);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user