virt: add comment that we need to use sscanf()

Follow-up for 13e0f9fe83.
See PR #7890 and comment in PR #7581.
This commit is contained in:
Yu Watanabe 2018-01-16 23:00:39 +09:00
parent fb76275a7a
commit 47dbb99ad7

View file

@ -222,6 +222,8 @@ static int detect_vm_xen_dom0(void) {
if (r == 0) {
unsigned long features;
/* Here, we need to use sscanf() instead of safe_atoul()
* as the string lacks the leading "0x". */
r = sscanf(domcap, "%lx", &features);
if (r == 1) {
r = !!(features & (1U << XENFEAT_dom0));