Skip to content

Commit b29f582

Browse files
authored
Merge pull request #12 from ubruhin/fix-auth-key-conversion
fix converting authorization key to hex string
2 parents 8233c2f + 4634d2d commit b29f582

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MicroOcppMongooseClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ MOcppMongooseClient::MOcppMongooseClient(struct mg_mgr *mgr,
7171
char auth_key_hex [2 * MO_AUTHKEY_LEN_MAX + 1];
7272
auth_key_hex[0] = '\0';
7373
if (auth_key_factory) {
74-
for (size_t i = 0; i < auth_key_factory_len; i += 2) {
74+
for (size_t i = 0; i < auth_key_factory_len; i++) {
7575
snprintf(auth_key_hex + 2 * i, 3, "%02X", auth_key_factory[i]);
7676
}
7777
}
@@ -380,7 +380,7 @@ void MOcppMongooseClient::setAuthKey(const unsigned char *auth_key, size_t len)
380380

381381
char auth_key_hex [2 * MO_AUTHKEY_LEN_MAX + 1];
382382
auth_key_hex[0] = '\0';
383-
for (size_t i = 0; i < len; i += 2) {
383+
for (size_t i = 0; i < len; i++) {
384384
snprintf(auth_key_hex + 2 * i, 3, "%02X", auth_key[i]);
385385
}
386386

0 commit comments

Comments
 (0)