Fix a few cppcheck warnings.

Use the proper data type in format functions and fix a resource leak.
This commit is contained in:
XhmikosR
2013-10-10 00:05:22 -04:00
committed by TingPing
parent e244001cee
commit c226f4089a
5 changed files with 9 additions and 8 deletions

View File

@@ -140,11 +140,11 @@ print_summary (int announce, char* format)
if (giga)
{
snprintf (buffer, bsize, "%d x %s (%s) @ %.2fGHz", count, cpu_model, cpu_vendor, cpu_freq);
snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz", count, cpu_model, cpu_vendor, cpu_freq);
}
else
{
snprintf (buffer, bsize, "%d x %s (%s) @ %.0fMHz", count, cpu_model, cpu_vendor, cpu_freq);
snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz", count, cpu_model, cpu_vendor, cpu_freq);
}
format_output ("CPU", buffer, format);
@@ -332,11 +332,11 @@ print_cpu (int announce, char* format)
if (giga)
{
snprintf (buffer, bsize, "%d x %s (%s) @ %.2fGHz w/ %s L2 Cache", count, model, vendor, freq, cache);
snprintf (buffer, bsize, "%u x %s (%s) @ %.2fGHz w/ %s L2 Cache", count, model, vendor, freq, cache);
}
else
{
snprintf (buffer, bsize, "%d x %s (%s) @ %.0fMHz w/ %s L2 Cache", count, model, vendor, freq, cache);
snprintf (buffer, bsize, "%u x %s (%s) @ %.0fMHz w/ %s L2 Cache", count, model, vendor, freq, cache);
}
format_output ("CPU", buffer, format);