summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hexbin.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hexbin.c b/hexbin.c
index d312438..9356fff 100644
--- a/hexbin.c
+++ b/hexbin.c
@@ -11,16 +11,12 @@
int main()
{
uint8_t b;
- char ip[3] = {0};
while (1)
{
- fread(ip, 1, 2, stdin);
-
+ scanf("%hhx", &b);
if (feof(stdin))
break;
-
- sscanf(ip, "%hhx", &b);
fwrite(&b, 1, 1, stdout);
}