mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-profile: clamp to range
This commit is contained in:
@ -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.;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user