Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix bug. It must be unsigned.
Browse files Browse the repository at this point in the history
Before:
000906e9 (06-ffffff9e-09)

After:
000906e9 (06-9e-09)
  • Loading branch information
NewEraCracker committed Dec 25, 2018
1 parent 720891e commit 60e266b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ int main(int argc, char * argv[])
{
unsigned int id = cpuid(1);

char step = (id) & 0x0000000f;
char model = (((id >> 16) & 0x000000ff) << 4) | ((id >> 4) & 0x0000000f);
char family = (((id >> 20) & 0x000000ff) << 4) | ((id >> 8) & 0x0000000f);
unsigned char step = (id) & 0x0000000f;
unsigned char model = (((id >> 16) & 0x000000ff) << 4) | ((id >> 4) & 0x0000000f);
unsigned char family = (((id >> 20) & 0x000000ff) << 4) | ((id >> 8) & 0x0000000f);

printf("%08x (%02x-%02x-%02x)", id, family, model, step);

Expand Down

0 comments on commit 60e266b

Please sign in to comment.