Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Commit 5007e63

Browse files
committed
feat(C): support parse hex directly
1 parent 6cb8f32 commit 5007e63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ int main(int args, char *argv[]) {
134134
uint32_t crc;
135135

136136
if (args > 1) {
137-
sscanf(argv[1], "%u", &crc);
137+
sscanf(argv[1], "%8x", &crc);
138138
} else {
139-
if (scanf("%u", &crc) != 1) {
139+
if (scanf("%8x", &crc) != 1) {
140140
return -1;
141141
};
142142
}

0 commit comments

Comments
 (0)