mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix warning
This commit is contained in:
@@ -385,7 +385,7 @@ char * Helpers::render_value(char * result, const uint32_t value, const int8_t f
|
|||||||
char * Helpers::render_string(char * result, const char * c, const uint8_t len) {
|
char * Helpers::render_string(char * result, const char * c, const uint8_t len) {
|
||||||
char * p = result;
|
char * p = result;
|
||||||
while (*c != '\0' && (p - result < len)) {
|
while (*c != '\0' && (p - result < len)) {
|
||||||
switch (*c) {
|
switch ((uint8_t)*c) {
|
||||||
case 0xC4: // Ä
|
case 0xC4: // Ä
|
||||||
*p = 0xC3;
|
*p = 0xC3;
|
||||||
*(++p) = 0x84;
|
*(++p) = 0x84;
|
||||||
@@ -432,9 +432,9 @@ char * Helpers::render_string(char * result, const char * c, const uint8_t len)
|
|||||||
char * Helpers::utf8tolatin1(char * result, const char * c, const uint8_t len) {
|
char * Helpers::utf8tolatin1(char * result, const char * c, const uint8_t len) {
|
||||||
char * p = result;
|
char * p = result;
|
||||||
while (*c != '\0' && (p - result < len)) {
|
while (*c != '\0' && (p - result < len)) {
|
||||||
if (*c == 0xC3) {
|
if ((uint8_t)*c == 0xC3) {
|
||||||
c++;
|
c++;
|
||||||
switch (*c) {
|
switch ((uint8_t)*c) {
|
||||||
case 0x84: // Ä
|
case 0x84: // Ä
|
||||||
*p = 0xC4;
|
*p = 0xC4;
|
||||||
break;
|
break;
|
||||||
@@ -459,7 +459,7 @@ char * Helpers::utf8tolatin1(char * result, const char * c, const uint8_t len) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (*c > 127) {
|
} else if ((uint8_t)*c > 127) {
|
||||||
*p = '?';
|
*p = '?';
|
||||||
} else {
|
} else {
|
||||||
*p = *c;
|
*p = *c;
|
||||||
|
|||||||
Reference in New Issue
Block a user