Commit | Line | Data |
---|---|---|
9e8e5516 C |
1 | |
2 | # include <stdio.h> | |
3 | ||
4 | main() | |
5 | { | |
6 | unsigned int i; | |
7 | char buf[1]; | |
8 | register int result, count; | |
9 | ||
10 | while ((result = scanf("%02x", &i)) != EOF){ | |
11 | count++; | |
12 | buf[0]=(char) i; | |
13 | if (result) write(1, buf, 1); | |
14 | else | |
15 | { | |
16 | fprintf(stderr,"Conversion failed at byte number %d\n", count); | |
17 | exit(1); | |
18 | } | |
19 | } | |
20 | exit(0); | |
21 | } |