diff --git a/01h.c b/01h.c index b63217a..89628d3 100644 --- a/01h.c +++ b/01h.c @@ -250,14 +250,14 @@ VENDOR getCPUVendorInternal(struct cpuInfo* cpu) { char* getString_NumberCores(struct cpuInfo* cpu) { if(cpu->HT > 1) { - //2(N.Cores)7(' cores(')2(N.Threads)9(' threads)') - int size = 2+7+2+9+1; + //2(N.Cores)7(' cores(')3(N.Threads)9(' threads)') + int size = 2+7+3+9+1; char* string = malloc(sizeof(char)*size); - snprintf(string,size,"%d cores(%d threads)",cpu->nThreads,cpu->nThreads/cpu->HT); + snprintf(string,size,"%d cores(%d threads)",cpu->nThreads/cpu->HT,cpu->nThreads); return string; } else { - char* string = malloc(sizeof(char)*2+1); + char* string = malloc(sizeof(char)*2+7+1); snprintf(string,2+7+1,"%d cores",cpu->nThreads); return string; } diff --git a/README.md b/README.md index cdd5492..3a293e1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Prints a fancy summary of the CPU with some advanced information ### Platforms -This tool works on both 64 bits and 32 bits, but it's __Linux only__ because of its [implementation details](#implementation) +This tool works on both 64 bits and 32 bits, but it's __Linux only__ because of its [implementation details](#implementation). AMD support is not guaranteed so information may not be correct ### Usage and installation @@ -47,7 +47,7 @@ Output is detailed as follows: ### Implementation `cpufetch` makes use of two techniques to fetch data: -* __cpuid__: CPU name, number of threads per core and instructions features are fetched via _cpuid_. See [this](http://www.sandpile.org/x86/cpuid.htm) for more information. +* __cpuid__: CPU name, number of threads per core and instructions features are fetched via _cpuid_. See [this](http://www.sandpile.org/x86/cpuid.htm) and [Intel Processor Identification and the CPUID Instruction](https://www.scss.tcd.ie/~jones/CS4021/processor-identification-cpuid-instruction-note.pdf) for more information. * __udev__: Cache and frequency are fetched via _udev_, by looking at specific files from `/sys/devices/system/cpu` ### Bugs or improvements