Upravy na zaklade clang-tidy

This commit is contained in:
Pavel Brychta 2023-05-20 11:52:41 +02:00
parent a3da39e6aa
commit 1692a2adf4
2 changed files with 8 additions and 10 deletions

View File

@ -13,7 +13,7 @@ bool isBase64(const char *p)
return false; return false;
do { do {
c = *p; c = *p;
if (isalnum(c)) // alphanumberics are OK if (isalnum(c)) // alphanumerics are OK
continue; continue;
if (c == '/' || c == '+' || c == '=') // + or / or = is OK. if (c == '/' || c == '+' || c == '=') // + or / or = is OK.
continue; continue;
@ -54,9 +54,6 @@ void strDecode(String &str)
const char *src = &str[0]; const char *src = &str[0];
uint8_t key[4]; uint8_t key[4];
unsigned int enciphidx = 0;
unsigned int i;
uint8_t b;
uint32_t cid = ESP_getChipId(); uint32_t cid = ESP_getChipId();
uint32_t* pkey = (uint32_t *)&key[0]; uint32_t* pkey = (uint32_t *)&key[0];
uint8_t data[str.length()]; uint8_t data[str.length()];
@ -66,6 +63,10 @@ void strDecode(String &str)
unsigned int clen = base64_decode_chars(src, str.length(), (char *)data); unsigned int clen = base64_decode_chars(src, str.length(), (char *)data);
if (0 != clen) { if (0 != clen) {
unsigned int enciphidx = 0;
unsigned int i;
uint8_t b;
*pkey = cid; *pkey = cid;
for (i = 0; i < clen; i++) { for (i = 0; i < clen; i++) {
b = data[i]; b = data[i];

View File

@ -1,5 +1,4 @@
#ifndef _ENCSTRING_HPP_ #pragma once
#define _ENCSTRING_HPP_
#include <Arduino.h> #include <Arduino.h>
/** /**
@ -24,5 +23,3 @@ void strDecode(String &str);
* @return false Retezec neni kodovany pomoci Base64 * @return false Retezec neni kodovany pomoci Base64
*/ */
bool isBase64(const char *p); bool isBase64(const char *p);
#endif