From: Yu Watanabe Date: Tue, 16 Jan 2018 14:00:39 +0000 (+0900) Subject: virt: add comment that we need to use sscanf() X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f1eacb3a95b1c9ed8869cdc3345546fba266f170;p=elogind.git virt: add comment that we need to use sscanf() Follow-up for 13e0f9fe8334859ee86f4ff725374d1d83f5baf7. See PR #7890 and comment in PR #7581. --- 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));