libsysprof-profile: clamp to range

This commit is contained in:
Christian Hergert
2023-06-30 12:43:31 -07:00
parent dfcba71fd7
commit 14e6952726

View File

@ -116,6 +116,8 @@ get_cpu_freq (int stat_fd,
g_strchug (buf);
val = g_ascii_strtoll (buf, NULL, 10);
val = CLAMP (val, .0, max);
return (double)val / max * 100.;
}