mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
JSON: don't print the non-standand NaN
This commit is contained in:
+1
-1
@@ -1274,7 +1274,7 @@ int main(int argc, const char** argv)
|
||||
|
||||
if (instance.state.resultDoc)
|
||||
{
|
||||
yyjson_mut_write_fp(stdout, instance.state.resultDoc, YYJSON_WRITE_ALLOW_INF_AND_NAN | YYJSON_WRITE_PRETTY_TWO_SPACES, NULL, NULL);
|
||||
yyjson_mut_write_fp(stdout, instance.state.resultDoc, YYJSON_WRITE_INF_AND_NAN_AS_NULL | YYJSON_WRITE_PRETTY_TWO_SPACES, NULL, NULL);
|
||||
}
|
||||
|
||||
ffFinish();
|
||||
|
||||
@@ -157,10 +157,7 @@ void ffGenerateCPUJson(FFCPUOptions* options, yyjson_mut_doc* doc, yyjson_mut_va
|
||||
yyjson_mut_obj_add_uint(doc, obj, "coresOnline", cpu.coresOnline);
|
||||
yyjson_mut_obj_add_real(doc, obj, "frequencyMin", cpu.frequencyMin);
|
||||
yyjson_mut_obj_add_real(doc, obj, "frequencyMax", cpu.frequencyMax);
|
||||
if (cpu.temperature == cpu.temperature)
|
||||
yyjson_mut_obj_add_real(doc, obj, "temperature", cpu.temperature);
|
||||
else
|
||||
yyjson_mut_obj_add_null(doc, obj, "temperature");
|
||||
yyjson_mut_obj_add_real(doc, obj, "temperature", cpu.temperature);
|
||||
}
|
||||
|
||||
ffStrbufDestroy(&cpu.name);
|
||||
|
||||
@@ -256,10 +256,7 @@ void ffGenerateGPUJson(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_mut_va
|
||||
else
|
||||
yyjson_mut_obj_add_null(doc, sharedObj, "used");
|
||||
|
||||
if (gpu->temperature == gpu->temperature)
|
||||
yyjson_mut_obj_add_real(doc, obj, "temperature", gpu->temperature);
|
||||
else
|
||||
yyjson_mut_obj_add_null(doc, obj, "temperature");
|
||||
yyjson_mut_obj_add_null(doc, obj, "temperature");
|
||||
|
||||
const char* type;
|
||||
switch (gpu->type)
|
||||
|
||||
Reference in New Issue
Block a user