aboutsummaryrefslogtreecommitdiff
path: root/client/xxd.c
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-05-26 11:28:24 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-05-26 11:28:24 +0200
commitcad919018ed72005d2bc110247087201b0dea7ab (patch)
tree69857b1111fb3e5cb4f5a826985338f39aaec449 /client/xxd.c
parentc3491119759462aeb3eed4b39aa34f6f98ab8a4f (diff)
fix silly typo
Diffstat (limited to 'client/xxd.c')
-rw-r--r--client/xxd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/client/xxd.c b/client/xxd.c
index 06b9960..5d83635 100644
--- a/client/xxd.c
+++ b/client/xxd.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <ctype.h>
-#include "parse.h"
+#include "xxd.h"
void xxd(const char * data, size_t size) {
size_t fake_size = size + (16 - size % 16) % 16;
@@ -20,7 +20,7 @@ void xxd(const char * data, size_t size) {
continue;
}
- printf("%02x ", data[size]);
+ printf("%02x ", data[i] & 0xff);
}
// print ascii representation
@@ -33,8 +33,8 @@ void xxd(const char * data, size_t size) {
continue;
}
- if (isprint(data[size]))
- printf("%c", data[size]);
+ if (isprint(data[i]))
+ printf("%c", data[i]);
else
printf(".");
}