diff options
Diffstat (limited to 'other')
-rw-r--r-- | other/DHT_bootstrap.c | 4 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/config.c | 4 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/tox-bootstrapd.c | 2 | ||||
-rw-r--r-- | other/fun/cracker.c | 2 | ||||
-rw-r--r-- | other/fun/sign.c | 4 | ||||
-rw-r--r-- | other/fun/strkey.c | 4 |
6 files changed, 12 insertions, 8 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c index bbb4844e..5f04e415 100644 --- a/other/DHT_bootstrap.c +++ b/other/DHT_bootstrap.c | |||
@@ -156,8 +156,8 @@ int main(int argc, char *argv[]) | |||
156 | 156 | ||
157 | for (i = 0; i < 32; i++) { | 157 | for (i = 0; i < 32; i++) { |
158 | const uint8_t *const self_public_key = dht_get_self_public_key(dht); | 158 | const uint8_t *const self_public_key = dht_get_self_public_key(dht); |
159 | printf("%02hhX", self_public_key[i]); | 159 | printf("%02X", self_public_key[i]); |
160 | fprintf(file, "%02hhX", self_public_key[i]); | 160 | fprintf(file, "%02X", self_public_key[i]); |
161 | } | 161 | } |
162 | 162 | ||
163 | fclose(file); | 163 | fclose(file); |
diff --git a/other/bootstrap_daemon/src/config.c b/other/bootstrap_daemon/src/config.c index 3f1592e6..a3c1f250 100644 --- a/other/bootstrap_daemon/src/config.c +++ b/other/bootstrap_daemon/src/config.c | |||
@@ -316,7 +316,9 @@ static uint8_t *hex_string_to_bin(const char *hex_string) | |||
316 | size_t i; | 316 | size_t i; |
317 | 317 | ||
318 | for (i = 0; i < len; ++i, pos += 2) { | 318 | for (i = 0; i < len; ++i, pos += 2) { |
319 | sscanf(pos, "%2hhx", &ret[i]); | 319 | unsigned int val; |
320 | sscanf(pos, "%02x", &val); | ||
321 | ret[i] = val; | ||
320 | } | 322 | } |
321 | 323 | ||
322 | return ret; | 324 | return ret; |
diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index bdf679c9..9f1a2db4 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c | |||
@@ -109,7 +109,7 @@ static void print_public_key(const uint8_t *public_key) | |||
109 | size_t i; | 109 | size_t i; |
110 | 110 | ||
111 | for (i = 0; i < CRYPTO_PUBLIC_KEY_SIZE; i++) { | 111 | for (i = 0; i < CRYPTO_PUBLIC_KEY_SIZE; i++) { |
112 | index += sprintf(buffer + index, "%02hhX", public_key[i]); | 112 | index += sprintf(buffer + index, "%02X", public_key[i]); |
113 | } | 113 | } |
114 | 114 | ||
115 | log_write(LOG_LEVEL_INFO, "Public Key: %s\n", buffer); | 115 | log_write(LOG_LEVEL_INFO, "Public Key: %s\n", buffer); |
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 { |