modbus_tcp
checking if ext is null but not utilising it to skip over the strcmp's
This commit is contained in:
@@ -109,8 +109,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
|||||||
const char* ext = strrchr(file_list[registers[REG_IMAGE_NR] - 1].name, '.');
|
const char* ext = strrchr(file_list[registers[REG_IMAGE_NR] - 1].name, '.');
|
||||||
if (ext == NULL) {
|
if (ext == NULL) {
|
||||||
LOG_CRIT(TAG, "No valid extension found");
|
LOG_CRIT(TAG, "No valid extension found");
|
||||||
}
|
} else if (strcmp(ext, ".gif") == 0) {
|
||||||
if (strcmp(ext, ".gif") == 0) {
|
|
||||||
lcd_draw_gif_from_fs(file_list[registers[REG_IMAGE_NR] - 1].name, 0, 75);
|
lcd_draw_gif_from_fs(file_list[registers[REG_IMAGE_NR] - 1].name, 0, 75);
|
||||||
} else if (strcmp(ext, ".bmp") == 0) {
|
} else if (strcmp(ext, ".bmp") == 0) {
|
||||||
lcd_draw_img_from_fs(file_list[registers[REG_IMAGE_NR] - 1].name, 0, 75);
|
lcd_draw_img_from_fs(file_list[registers[REG_IMAGE_NR] - 1].name, 0, 75);
|
||||||
|
|||||||
Reference in New Issue
Block a user