dont use format string if an error occures

This commit is contained in:
Linus Dierheimer
2021-04-03 21:51:50 +02:00
parent 67465d266e
commit e01d03f98d
13 changed files with 198 additions and 152 deletions
+7 -6
View File
@@ -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);
}