---
src/lib/util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/util.c b/src/lib/util.c
index 2345d1f..66c78df 100644
--- a/src/lib/util.c
+++ b/src/lib/util.c
@@ -547,7 +547,8 @@ int get_num_cpu(void)
return 1;
}
while (fgets(str, sizeof(str), fd)) {
- if (!strncmp(str, "processor", 9))
+ char const proc_ptrn[] = "processor";
+ if (!strncmp(str, proc_ptrn, sizeof(proc_ptrn) - 1))
ncpu++;
}
fclose(fd);
--
1.7.9.5
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel