summaryrefslogtreecommitdiff
path: root/other/fun
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-23 17:11:00 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-03-16 01:57:26 +0000
commitaa050954195f6323775ed68f4262edf2341c6953 (patch)
tree0b2f53b23b97dc1e90f798ae97321a727c413462 /other/fun
parent78d5b74dcee1208efe19dd115006034501c4380f (diff)
Remove the use of the 'hh' format specifier.
It's not supported in mingw. See https://github.com/TokTok/c-toxcore/issues/786.
Diffstat (limited to 'other/fun')
-rw-r--r--other/fun/cracker.c2
-rw-r--r--other/fun/sign.c4
-rw-r--r--other/fun/strkey.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/other/fun/cracker.c b/other/fun/cracker.c
index 7b020bb7..9cfe96d7 100644
--- a/other/fun/cracker.c
+++ b/other/fun/cracker.c
@@ -24,7 +24,7 @@ void print_key(uint8_t *client_id)
24 uint32_t j; 24 uint32_t j;
25 25
26 for (j = 0; j < 32; j++) { 26 for (j = 0; j < 32; j++) {
27 printf("%02hhX", client_id[j]); 27 printf("%02X", client_id[j]);
28 } 28 }
29} 29}
30 30
diff --git a/other/fun/sign.c b/other/fun/sign.c
index b24cdae7..369bc848 100644
--- a/other/fun/sign.c
+++ b/other/fun/sign.c
@@ -56,13 +56,13 @@ int main(int argc, char *argv[])
56 int i; 56 int i;
57 57
58 for (i = 0; i < crypto_sign_ed25519_PUBLICKEYBYTES; i++) { 58 for (i = 0; i < crypto_sign_ed25519_PUBLICKEYBYTES; i++) {
59 printf("%02hhX", pk[i]); 59 printf("%02X", pk[i]);
60 } 60 }
61 61
62 printf("\nSecret key:\n"); 62 printf("\nSecret key:\n");
63 63
64 for (i = 0; i < crypto_sign_ed25519_SECRETKEYBYTES; i++) { 64 for (i = 0; i < crypto_sign_ed25519_SECRETKEYBYTES; i++) {
65 printf("%02hhX", sk[i]); 65 printf("%02X", sk[i]);
66 } 66 }
67 67
68 printf("\n"); 68 printf("\n");
diff --git a/other/fun/strkey.c b/other/fun/strkey.c
index 649b26dd..ef54a404 100644
--- a/other/fun/strkey.c
+++ b/other/fun/strkey.c
@@ -86,7 +86,9 @@ int main(int argc, char *argv[])
86 size_t i; 86 size_t i;
87 87
88 for (i = 0; i < len; pos += 2) { 88 for (i = 0; i < len; pos += 2) {
89 sscanf(pos, "%2hhx", &desired_bin[i]); 89 unsigned int value;
90 sscanf(pos, "%02x", &value);
91 desired_bin[i] = value;
90 ++i; 92 ++i;
91 } 93 }
92 } else { 94 } else {