[PATCH] ntdll: Increase size of buffer used to read lines of /proc/cpuinfo

jimportal at gmail.com jimportal at gmail.com
Wed Nov 24 13:23:12 CST 2010


From: James Eder <jimportal at gmail.com>

fill_cpu_info (on Linux) only reads the first 200 characters of lines in
/proc/cpuinfo. On newer CPUs, a "flags" line can be much longer (375 chars
on my system).  This patch increases the size of the buffer so we don't
miss any important flags.
---
 dlls/ntdll/nt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index ba4202f..28afa2d 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -946,12 +946,12 @@ void fill_cpu_info(void)
 
 #ifdef linux
     {
-	char line[200];
+	char line[450];
 	FILE *f = fopen ("/proc/cpuinfo", "r");
 
 	if (!f)
 		return;
-	while (fgets(line,200,f) != NULL)
+	while (fgets(line,450,f) != NULL)
         {
             char	*s,*value;
 
-- 
1.7.3.2




More information about the wine-patches mailing list