]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
virt: add comment that we need to use sscanf()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2018 14:00:39 +0000 (23:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2018 14:00:39 +0000 (23:00 +0900)
Follow-up for 13e0f9fe8334859ee86f4ff725374d1d83f5baf7.
See PR #7890 and comment in PR #7581.

src/basic/virt.c

index 9b6abf9f19d4cef51448f261ee28b60e1b7fedc2..f4796b53bc2a4e6d14f8570b4f005501c6b94197 100644 (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));