From f1eacb3a95b1c9ed8869cdc3345546fba266f170 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 16 Jan 2018 23:00:39 +0900 Subject: virt: add comment that we need to use sscanf() Follow-up for 13e0f9fe8334859ee86f4ff725374d1d83f5baf7. See PR #7890 and comment in PR #7581. --- src/basic/virt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/basic/virt.c') diff --git a/src/basic/virt.c b/src/basic/virt.c index 4c3791381..bb6b70f98 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -223,6 +223,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)); -- cgit v1.2.3