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;
do {
c = *p;
if (isalnum(c)) // alphanumberics are OK
if (isalnum(c)) // alphanumerics are OK
continue;
if (c == '/' || c == '+' || c == '=') // + or / or = is OK.
continue;
@ -31,7 +31,7 @@ void strEncode(String &str)
char c;
unsigned int i;
uint32_t cid = ESP_getChipId();
uint32_t *pkey = (uint32_t *)&key[0];
uint32_t* pkey = (uint32_t *)&key[0];
uint8_t data[str.length()];
*pkey = cid;
@ -54,11 +54,8 @@ void strDecode(String &str)
const char *src = &str[0];
uint8_t key[4];
unsigned int enciphidx = 0;
unsigned int i;
uint8_t b;
uint32_t cid = ESP_getChipId();
uint32_t *pkey = (uint32_t *)&key[0];
uint32_t* pkey = (uint32_t *)&key[0];
uint8_t data[str.length()];
String result = F("");
@ -66,6 +63,10 @@ void strDecode(String &str)
unsigned int clen = base64_decode_chars(src, str.length(), (char *)data);
if (0 != clen) {
unsigned int enciphidx = 0;
unsigned int i;
uint8_t b;
*pkey = cid;
for (i = 0; i < clen; i++) {
b = data[i];

View File

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