|
|
@ -112,12 +112,12 @@ fetch_cpu_info(fetched_info* fi){
|
|
|
|
#define VEND "vendor_id"
|
|
|
|
#define VEND "vendor_id"
|
|
|
|
if(strncmp(buf, TAG, strlen(TAG)) == 0){
|
|
|
|
if(strncmp(buf, TAG, strlen(TAG)) == 0){
|
|
|
|
// model name trumps vendor_id
|
|
|
|
// model name trumps vendor_id
|
|
|
|
free(fi->cpu_model);
|
|
|
|
|
|
|
|
char* start = strchr(buf + strlen(TAG), ':');
|
|
|
|
char* start = strchr(buf + strlen(TAG), ':');
|
|
|
|
if(start){
|
|
|
|
if(start){
|
|
|
|
++start;
|
|
|
|
++start;
|
|
|
|
char* nl = strchr(start, '\n');
|
|
|
|
char* nl = strchr(start, '\n');
|
|
|
|
*nl = '\0';
|
|
|
|
*nl = '\0';
|
|
|
|
|
|
|
|
free(fi->cpu_model);
|
|
|
|
fi->cpu_model = strdup(start);
|
|
|
|
fi->cpu_model = strdup(start);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if(strncmp(buf, VEND, strlen(VEND)) == 0){
|
|
|
|
}else if(strncmp(buf, VEND, strlen(VEND)) == 0){
|
|
|
|