sensors: json: Skip printing an unnecessary newline

Don't print a newline if no features were printed.

This is based on a patch from the su8 user on GitHub.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk committed 2019-05-05 11:43:44 +02:00
1 parent 1020728a96
commit 50f227dafe
1 file changed
+2 -1
+2 -1
View File
@@ -112,7 +112,8 @@ void print_chip_json(const sensors_chip_name *name)
printf("\n }");
cnt++;
}
printf("\n");
if (cnt > 0)
printf("\n");
}
static const char hyst_str[] = "hyst";